Merge "Fix SerialPort" into tizen_2.1
authorJoohyun Kim <joohyune.kim@samsung.com>
Wed, 17 Apr 2013 13:26:32 +0000 (22:26 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 17 Apr 2013 13:26:32 +0000 (22:26 +0900)
15 files changed:
inc/FBaseLog.h
inc/FBaseSysLog.h
src/app/FApp_AppControlRegistry.cpp
src/app/FApp_AppInfo.cpp
src/app/FApp_AppMessageImpl.cpp
src/app/FApp_AppSettingImpl.cpp
src/app/inc/FApp_AppMessageImpl.h
src/app/package/FAppPkg_PackageManagerImpl.cpp
src/io/FIo_DataControlResultSetImpl.cpp
src/io/FIo_FileImpl.cpp
src/io/FIo_MessagePortProxy.cpp
src/locales/FLclCalendar.cpp
src/locales/FLclLocale.cpp
src/locales/FLcl_CalendarImpl.cpp
src/locales/FLcl_CalendarImpl.h

index 6426fa4..ab6562b 100644 (file)
@@ -755,121 +755,582 @@ extern "C" {
  *
  * @{
  */
+
 #if (defined(_APP_LOG) || defined(_OSP_DEBUG_) || defined(_DEBUG)) && defined(_SECURE_LOG)
 
 #define AppSecureLog(...)                      AppLogInternal(__PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
+#define AppSecureLogDebug(...)                 AppLogDebugInternal(__PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
 #define AppSecureLogException(...)             AppLogExceptionInternal(__PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
 
 #define AppSecureLogTag(tag, ...)              AppLogTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
+#define AppSecureLogDebugTag(tag, ...)         AppLogDebugTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
 #define AppSecureLogExceptionTag(tag, ...)     AppLogExceptionTagInternal(tag, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__)
 
 #else
 /**
-* This macro is to protect informative log messages which needs to keep security.
-* It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-*
-* @since 2.1
-*
-* @param[in]   ...                     The message to display
-*
-* The following example demonstrates how to use the AppSecureLog macro.
-*
-* @code
-*        bool
-*        MyEngine::Init(int value)
-*        {
-*           AppSecureLog("User ID : 'JoneDoe'");
-*
-*           return true;
-*        }
-* @endcode
-* @hideinitializer
-*/
+ * This macro is to protect informative log messages which needs to keep security.
+ * It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  ...                     The message to display
+ *
+ * The following example demonstrates how to use the AppSecureLog macro.
+ *
+ * @code
+ *        bool
+ *        MyEngine::Init(int value)
+ *        {
+ *           AppSecureLog("User ID : 'JoneDoe'");
+ *
+ *           return true;
+ *        }
+ * @endcode
+ * @hideinitializer
+ */
 #define AppSecureLog(...)
 
 /**
-* This macro is to protect exception log messages which needs to keep security.
-* It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-*
-* @since 2.1
-*
-* @param[in]   ...                     The message to display
-*
-* The following example demonstrates how to use the AppSecureLogException macro.
-*
-* @code
-*        bool
-*        MyEngine::Init(int value)
-*        {
-*           //...
-*           if (something_wrong)
-*           {
-*              AppSecureLogException("User ID : 'JoneDoe' mismatch.");
-*
-*              return false;
-*           }
-*   //...
-*
-*           return true;
-*        }
-* @endcode
-* @hideinitializer
-*/
+ * This macro is to protect debug log messages which needs to keep security.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  ...                     The message to display
+ *
+ * The following example demonstrates how to use the AppSecureLogDebug macro.
+ *
+ * @code
+ *        bool
+ *        MyEngine::Init(int value)
+ *        {
+ *           //...
+ *           if (something_wrong)
+ *           {
+ *              AppSecureLogDebug("User ID : 'JoneDoe' mismatch.");
+ *
+ *              return false;
+ *           }
+ *   //...
+ *
+ *           return true;
+ *        }
+ * @endcode
+ * @hideinitializer
+ */
+#define AppSecureLogDebug(...)
+
+/**
+ * This macro is to protect exception log messages which needs to keep security.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  ...                     The message to display 
+ *
+ * The following example demonstrates how to use the AppSecureLogException macro.
+ *
+ * @code
+ *        bool
+ *        MyEngine::Init(int value)
+ *        {
+ *           //...
+ *           if (something_wrong)
+ *           {
+ *              AppSecureLogException("User ID : 'JoneDoe' mismatch.");
+ *
+ *              return false;
+ *           }
+ *   //...
+ *
+ *           return true;
+ *        }
+ * @endcode
+ * @hideinitializer
+ */
 #define AppSecureLogException(...)
 
 /**
-* This macro is to protect informative log messages which needs to keep security, with a tag.
-* It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-*
-* @since 2.1
-*
-* @param[in]   tag                     The user defined tag
-* @param[in]   ...                     The message to display
-*
-* The following example demonstrates how to use the AppSecureLogTag macro.
-*
-* @code
-*        bool
-*        MyEngine::Init(int value)
-*        {
-*           AppSecureLogTag("MyTag", "User ID : 'JoneDoe'");
-*
-*           return true;
-*        }
-* @endcode
-* @hideinitializer
-*/
+ * This macro is to protect informative log messages which needs to keep security, with a tag.
+ * It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  tag                     The user defined tag
+ * @param[in]  ...                     The message to display
+ *
+ * The following example demonstrates how to use the AppSecureLogTag macro.
+ *
+ * @code
+ *        bool
+ *        MyEngine::Init(int value)
+ *        {
+ *           AppSecureLogTag("MyTag", "User ID : 'JoneDoe'");
+ *
+ *           return true;
+ *        }
+ * @endcode
+ * @hideinitializer
+ */
 #define AppSecureLogTag(tag, ...)
 
 /**
-* This macro is to protect exception log messages which needs to keep security, with a tag.
-* It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-*
-* @since 2.1
-*
-* @param[in]   tag                     The user defined tag
-* @param[in]   ...                     The message to display
-*
-* The following example demonstrates how to use the AppSecureLogExceptionTag macro.
-*
-* @code
-*        bool
-*        MyEngine::Init(int value)
-*        {
-*           AppSecureLogExceptionTag("MyTag", "User ID : 'JoneDoe' mismatch.");
-*
-*           return true;
-*        }
-* @endcode
-* @hideinitializer
-*/
+ * This macro is to protect debug log messages which needs to keep security, with a tag.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  tag                     The user defined tag
+ * @param[in]  ...                     The message to display
+ *
+ * The following example demonstrates how to use the AppSecureLogDebugTag macro.
+ *
+ * @code
+ *        bool
+ *        MyEngine::Init(int value)
+ *        {
+ *           AppSecureLogDebugTag("MyTag", "User ID : 'JoneDoe' mismatch.");
+ *
+ *           return true;
+ *        }
+ * @endcode
+ * @hideinitializer
+ */
+#define AppSecureLogDebugTag(tag, ...)
+
+/**
+ * This macro is to protect exception log messages which needs to keep security, with a tag.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  tag                     The user defined tag
+ * @param[in]  ...                     The message to display
+ *
+ * The following example demonstrates how to use the AppSecureLogExceptionTag macro.
+ *
+ * @code
+ *        bool
+ *        MyEngine::Init(int value)
+ *        {
+ *           AppSecureLogExceptionTag("MyTag", "User ID : 'JoneDoe' mismatch.");
+ *
+ *           return true;
+ *        }
+ * @endcode
+ * @hideinitializer
+ */
 #define AppSecureLogExceptionTag(tag, ...)
 
 #endif
+
+/**
+ * If the condition is @c false, it prints a message, evaluates a cleanup expression,
+ * and goes to <tt>CATCH</tt>.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  expr                    Expressions that are evaluated before going to CATCH label
+ * @param[in]  ...                     The message to display
+ *
+ * The following example demonstrates how to use the SecureTry macro.
+ *
+ * @code
+ *     result
+ *     MyClass::DoSomething(const String* passwd)
+ *     {
+ *        result r = E_SUCCESS;
+ *
+ *        // Do something...
+ *
+ *        // If password is wrong, print "[E_INVALID_ARG] The password '1234' is wrong." to the console
+ *        // execute the expression "r = E_INVALID_ARG", and move to CATCH
+ *        SecureTryCatch(*passwd != refPasswd, r = E_INVALID_ARG, "[E_INVALID_ARG] The password '%ls' is wrong.", passwd->GetPointer());
+ *
+ *        SetLastResult(E_SUCCESS);
+ *
+ *        return E_SUCCESS;// execute the expression "r = E_INVALID_ARG", and move to CATCH
+ *
+ *        CATCH:
+ *           SetLastResult(r);
+ *            // Do something
+ *
+ *           return r;
+ *     }
+ * @endcode
+ * @hideinitializer
+ */
+#define SecureTryCatch(condition, expr, ...) \
+       if (!(condition)) { \
+               AppSecureLogException(__VA_ARGS__); \
+               expr; \
+               goto CATCH;     \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, it prints a message, sets the last result, evaluates a cleanup expression
+ * and goes to <tt>CATCH</tt>.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  expr                    Expressions that are evaluated before going to CATCH label
+ * @param[in]  r                       The last result to set
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryCatchResult(condition, expr, r, ...) \
+       if (!(condition)) { \
+               SetLastResult(r); \
+               AppSecureLogException(__VA_ARGS__); \
+               expr; \
+               goto CATCH;     \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, it prints a message, sets the last result, evaluates a cleanup expression
+ * and goes to label.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]    condition             The condition that is expected to be true
+ * @param[in]    expr                  Expressions that are evaluated before going to catchLabel
+ * @param[in]    catchLabel            The label for goto operation
+ * @param[in]    r                     The last result to set
+ * @param[in]    ...                   The message to display
+ * @hideinitializer
+ */
+#define SecureTryCatchLabelResult(condition, expr, catchLabel, r, ...) \
+       if (!(condition)) { \
+               SetLastResult(r); \
+               AppSecureLogException(__VA_ARGS__); \
+               expr; \
+               goto catchLabel;        \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, the message is printed and a value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  returnValue             The value to return when the condition is @c false
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturn(condition, returnValue, ...)   \
+       if (!(condition)) { \
+               AppSecureLogException(__VA_ARGS__); \
+               return returnValue;     \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, the message is printed, sets the last result and a value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality  will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  returnValue             The value to return when the condition is @c false
+ * @param[in]  r                       The last result to set
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnResult(condition, returnValue, r, ...)  \
+       if (!(condition)) { \
+               SetLastResult(r); \
+               AppSecureLogException(__VA_ARGS__); \
+               return returnValue;     \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, the message is printed, sets the last result and no value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  r                       The last result to set
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnVoidResult(condition, r, ...)   \
+       if (!(condition)) { \
+               SetLastResult(r); \
+               AppSecureLogException(__VA_ARGS__); \
+               return; \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, the message is printed and no value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnVoid(condition, ...) \
+       if (!(condition)) { \
+               AppSecureLogException(__VA_ARGS__); \
+               return; \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, the message is printed.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryLog(condition, ...)   \
+       if (!(condition)) { \
+               AppSecureLog(__VA_ARGS__); \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, the informative log message is printed and a value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]    condition             The condition that is expected to be true
+ * @param[in]    returnValue           The value to return when the condition is @c false
+ * @param[in]    ...                   The message to display
+ * @hideinitializer
+ */
+#define SecureTryLogReturn(condition, returnValue, ...) \
+       if (!(condition)) { \
+               AppSecureLog(__VA_ARGS__); \
+               return returnValue;     \
+       } \
+       else {;}
+
+// SecureTryTag Macros
+
+/**
+ * If the condition is @c false, it prints a message with a tag, evaluates a cleanup expression
+ * and goes to <tt>CATCH</tt>.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  tag                     Used to identify the source of a log message
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  expr                    Expressions that are evaluated before going to CATCH label
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryCatchTag(tag, condition, expr, ...) \
+       if (!(condition)) { \
+               AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+               expr; \
+               goto CATCH;     \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, it prints a message with a tag, sets the last result, evaluates a cleanup expression,
+ * and goes to <tt>CATCH</tt>.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  tag                     Used to identify the source of a log message
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  expr                    Expressions that are evaluated before going to CATCH label
+ * @param[in]  r                       The last result to set
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryCatchResultTag(tag, condition, expr, r, ...) \
+       if (!(condition)) { \
+               SetLastResult(r); \
+               AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+               expr; \
+               goto CATCH;     \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, it prints a message with a tag, sets the last result, evaluates a cleanup expression
+ * and goes to label.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]    tag                   Used to identify the source of a log message
+ * @param[in]    condition             The condition that is expected to be true
+ * @param[in]    expr                  Expressions that are evaluated before going to catchLabel
+ * @param[in]    catchLabel            The label for goto operation
+ * @param[in]    r                     The last result to set
+ * @param[in]    ...                   The message to display
+ * @hideinitializer
+ */
+#define SecureTryCatchLabelResultTag(tag, condition, expr, catchLabel, r, ...) \
+       if (!(condition)) { \
+               SetLastResult(r); \
+               AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+               expr; \
+               goto catchLabel;        \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, the message is printed with a tag and a value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  tag                     Used to identify the source of a log message
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  returnValue             The value to return when the condition is @c false
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnTag(tag, condition, returnValue, ...)   \
+       if (!(condition)) { \
+               AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+               return returnValue;     \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, the message is printed with a tag, sets the last result and a value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  tag                     Used to identify the source of a log message
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  returnValue             The value to return when the condition is @c false
+ * @param[in]  r                       The last result to set
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnResultTag(tag, condition, returnValue, r, ...)  \
+       if (!(condition)) { \
+               SetLastResult(r); \
+               AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+               return returnValue;     \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, the message is printed with a tag, sets the last result and no value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  tag                     Used to identify the source of a log message
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  r                       The last result to set
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnVoidResultTag(tag, condition, r, ...)   \
+       if (!(condition)) { \
+               SetLastResult(r); \
+               AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+               return; \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, the message is printed with a tag and no value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  tag                     Used to identify the source of a log message
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryReturnVoidTag(tag, condition, ...) \
+       if (!(condition)) { \
+               AppSecureLogExceptionTag(tag, __VA_ARGS__); \
+               return; \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, the message is printed with a tag.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]  tag                     Used to identify the source of a log message
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  ...                     The message to display
+ * @hideinitializer
+ */
+#define SecureTryLogTag(tag, condition, ...)   \
+       if (!(condition)) { \
+               AppSecureLogTag(tag, __VA_ARGS__); \
+       } \
+       else {;}
+
+/**
+ * If the condition is @c false, the informative log message is printed with a tag and a value is returned.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ *
+ * @since 2.1
+ *
+ * @param[in]    tag                   Used to identify the source of a log message
+ * @param[in]    condition             The condition that is expected to be true
+ * @param[in]    returnValue           The value to return when the condition is @c false
+ * @param[in]    ...                   The message to display
+ * @hideinitializer
+ */
+#define SecureTryLogReturnTag(tag, condition, returnValue, ...) \
+       if (!(condition)) { \
+               AppSecureLogTag(tag, __VA_ARGS__); \
+               return returnValue;     \
+       } \
+       else {;}
+
 /** @} */
 
 _OSP_EXPORT_ void AppLogInternal(const char* pFunction, int lineNumber, const char* pFormat, ...);
@@ -882,7 +1343,6 @@ _OSP_EXPORT_ void AppLogTagInternal(const char* pTag, const char* pFunction, int
 _OSP_EXPORT_ void AppLogDebugTagInternal(const char* pTag, const char* pFunction, int lineNumber, const char* pFormat, ...);
 _OSP_EXPORT_ void AppLogExceptionTagInternal(const char* pTag, const char* pFunction, int lineNumber, const char* pFormat, ...);
 
-
 #ifdef __cplusplus
 }
 #endif
index 17e74e8..162fd00 100644 (file)
@@ -185,7 +185,7 @@ extern "C" {
  * The following example demonstrates how to use the SysTryLog macro.
  *
  * @code
- *     bool
+ *     void
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -334,7 +334,7 @@ extern "C" {
  *
  * @code
  * #define E_UNKNOWN_ERROR 1
- *     bool
+ *     result
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -342,7 +342,7 @@ extern "C" {
  *        SysTryReturnResult(NID, condition, E_UNKNOWN_ERROR, "An unexpected error has occurred.");
  *
  *        //...
- *        return true;
+ *        return E_SUCCESS;
  *     }
  * @endcode
  * @hideinitializer
@@ -370,7 +370,7 @@ extern "C" {
  * The following example demonstrates how to use the SysTryReturnVoidResult macro.
  *
  * @code
- *     bool
+ *     void
  *     MyEngine::Init(int value)
  *     {
  *        //...
@@ -378,7 +378,7 @@ extern "C" {
  *        SysTryReturnVoidResult(NID, condition,  E_INVALID_ARG, "An unexpected error has occurred.");
  *
  *        //...
- *        return true;
+ *        return;
  *     }
  * @endcode
  * @hideinitializer
@@ -606,123 +606,343 @@ case condition: \
 #else
 
 /**
-* This macro is to protect informative log messages which needs to keep security.
-* It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-* This system log macro is for the platform modules.
-*
-* @since 2.1
-*
-* @param[in]   NID                     The Tizen namespace ID
-* @param[in]   ...                     The message to display
-*
-* The following example demonstrates how to use the SysSecureLog macro.
-*
-* @code
-*        bool
-*        MyEngine::Init(int value)
-*        {
-*           SysSecureLog(NID, "User ID : 'JoneDoe'");
-*
-*           return true;
-*        }
-* @endcode
-* @hideinitializer
-*/
+ * This macro is to protect informative log messages which needs to keep security.
+ * It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in]  NID                     The Tizen namespace ID
+ * @param[in]  ...                     The message to display
+ *
+ * The following example demonstrates how to use the SysSecureLog macro.
+ *
+ * @code
+ *        bool
+ *        MyEngine::Init(int value)
+ *        {
+ *           SysSecureLog(NID, "User ID : 'JoneDoe'");
+ *
+ *           return true;
+ *        }
+ * @endcode
+ * @hideinitializer
+ */
 #define SysSecureLog(NID, ...)
 
 /**
-* This macro is to protect exception log messages which needs to keep security, and sets the last result.
-* It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-* This system log macro is for the platform modules.
-*
-* @since 2.1
-*
-* @param[in]   NID                     The Tizen namespace ID
-* @param[in]   r                       The last result to set
-* @param[in]   ...                     The message to display
-*
-* The following example demonstrates how to use the SysSecureLogException macro.
-*
-* @code
-*        bool
-*        MyEngine::Init(int value)
-*        {
-*           //...
-*           if (something_wrong)
-*           {
-*              SysSecureLogException(NID,  E_INVALID_ARG, "User ID : 'JoneDoe' mismatch.");
-*
-*              return false;
-*           }
-*   //...
-*
-*           return true;
-*        }
-* @endcode
-* @hideinitializer
-*/
-#define SysSecureLogException(NID, r,...)
-
-/**
-* This macro is to protect informative log messages which needs to keep security, with a tag.
-* It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-* This system log macro is for the platform modules.
-*
-* @since 2.1
-*
-* @param[in]   NID                     The Tizen namespace ID
-* @param[in]   tag                     The user defined tag
-* @param[in]   ...                     The message to display
-*
-* The following example demonstrates how to use the SysSecureLogTag macro.
-*
-* @code
-*        bool
-*        MyEngine::Init(int value)
-*        {
-*           SysSecureLogTag(NID, "MyTag", "User ID : 'JoneDoe'");
-*
-*           return true;
-*        }
-* @endcode
-* @hideinitializer
-*/
+ * This macro is to protect exception log messages which needs to keep security, and sets the last result.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in]  NID                     The Tizen namespace ID
+ * @param[in]  r                       The last result to set
+ * @param[in]  ...                     The message to display
+ *
+ * The following example demonstrates how to use the SysSecureLogException macro.
+ *
+ * @code
+ *        bool
+ *        MyEngine::Init(int value)
+ *        {
+ *           //...
+ *           if (something_wrong)
+ *           {
+ *              SysSecureLogException(NID,  E_INVALID_ARG, "User ID : 'JoneDoe' mismatch.");
+ *
+ *              return false;
+ *           }
+ *   //...
+ *
+ *           return true;
+ *        }
+ * @endcode
+ * @hideinitializer
+ */
+#define SysSecureLogException(NID, r,...)                      SetLastResult(r);
+
+/**
+ * This macro is to protect informative log messages which needs to keep security, with a tag.
+ * It allows display of informative log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, it will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in]  NID                     The Tizen namespace ID
+ * @param[in]  tag                     The user defined tag
+ * @param[in]  ...                     The message to display
+ *
+ * The following example demonstrates how to use the SysSecureLogTag macro.
+ *
+ * @code
+ *        bool
+ *        MyEngine::Init(int value)
+ *        {
+ *           SysSecureLogTag(NID, "MyTag", "User ID : 'JoneDoe'");
+ *
+ *           return true;
+ *        }
+ * @endcode
+ * @hideinitializer
+ */
 #define SysSecureLogTag(NID, tag, ...)
 
 /**
-* This macro is to protect exception log messages which needs to keep security, with a tag and sets the last result.
-* It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
-* Otherwise, it will be removed in the compile time.
-* This system log macro is for the platform modules.
-*
-* @since 2.1
-*
-* @param[in]   NID                     The Tizen namespace ID
-* @param[in]   tag                     The user defined tag
-* @param[in]   r                       The last result to set
-* @param[in]   ...                     The message to display
-*
-* The following example demonstrates how to use the SysSecureLogExceptionTag macro.
-*
-* @code
-*        bool
-*        MyEngine::Init(int value)
-*        {
-*           SysSecureLogExceptionTag(NID, "MyTag", E_INVALID_ARG, "User ID : 'JoneDoe' mismatch.");
-*
-*           return true;
-*        }
-* @endcode
-* @hideinitializer
-*/
-#define SysSecureLogExceptionTag(NID, tag, r, ...)
+ * This macro is to protect exception log messages which needs to keep security, with a tag and sets the last result.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in]  NID                     The Tizen namespace ID
+ * @param[in]  tag                     The user defined tag
+ * @param[in]  r                       The last result to set
+ * @param[in]  ...                     The message to display
+ *
+ * The following example demonstrates how to use the SysSecureLogExceptionTag macro.
+ *
+ * @code
+ *        bool
+ *        MyEngine::Init(int value)
+ *        {
+ *           SysSecureLogExceptionTag(NID, "MyTag", E_INVALID_ARG, "User ID : 'JoneDoe' mismatch.");
+ *
+ *           return true;
+ *        }
+ * @endcode
+ * @hideinitializer
+ */
+#define SysSecureLogExceptionTag(NID, tag, r, ...)             SetLastResult(r);
+
+#endif
+
+/**
+ * This macro allows display of informative log message with a tag, when the condition is @c false.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in]  NID                     The Tizen namespace
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]          ...                     The message to display
+ *
+ * The following example demonstrates how to use the SysSecureTry macro.
+ *
+ * @code
+ *     bool
+ *     MyEngine::Init(int value)
+ *     {
+ *        //...
+ *
+ *        SysSecureTryLog(NID, condition, "Password mismatch : %s", password );
+ *
+ *        //...
+ *     }
+ * @endcode
+ * @hideinitializer
+ */
+#define SysSecureTryLog(NID, condition, ...) \
+       do \
+       { \
+               if (unlikely(!(condition))) {   \
+                       SysSecureLog(NID, __VA_ARGS__); \
+               } \
+       } while (0);
+
+/**
+ * This macro allows display of informative log message, when the condition is @c false.
+ * Executes statements and goes to label.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in]  NID                     The Tizen namespace
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  expr                    Expressions that are evaluated before going to CATCH label
+ * @param[in]   ...                    The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryLogCatch(NID, condition, expr, ...)        \
+       do \
+       { \
+               if (unlikely(!(condition))) { \
+                       SysSecureLog(NID, __VA_ARGS__); \
+                       expr; \
+                       goto CATCH;     \
+               } \
+       } while (0);
+
+/**
+ * This macro allows display of informative log message and returns returnValue, when the condition is @c false.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in]  NID                     The Tizen namespace
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  returnValue             The value to return when the condition is @c false
+ * @param[in]   ...                    The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryLogReturn(NID, condition, returnValue, ...) \
+       do \
+       { \
+               if (unlikely(!(condition))) { \
+                       SysSecureLog(NID, __VA_ARGS__); \
+                       return returnValue;     \
+               } \
+       } while (0);
 
+/**
+ * This macro allows display of exception log message with a tag and sets the last result, when the condition is @c false.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in]  NID                     The Tizen namespace
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  returnValue             The value to return when the condition is @c false
+ * @param[in]  r                       The last result to set
+ * @param[in]   ...                    The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryReturn(NID, condition, returnValue, r, ...) \
+       do \
+       { \
+               if (unlikely(!(condition))) {   \
+                       SysSecureLogException(NID, r, __VA_ARGS__); \
+                       return returnValue;     \
+               } \
+       } while (0);
+
+#if defined(_SECURE_LOG)
+/**
+ * This macro allows display of exception log message with a tag and sets the last result, when the condition is @c false.
+ * This is a shorthand macro for SysSecureTryReturn(NID, condition, r, r, "[" # r "] " ...).
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in]  NID                     The Tizen namespace
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  r                       The last result to set
+ * @param[in]   ...                    The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryReturnResult(NID, condition, r, ...) \
+       do \
+       { \
+               if (unlikely(!(condition))) {   \
+                       SysTryReturnResultInternal(NID, r, __PRETTY_FUNCTION__, __LINE__, "[SECURE_LOG] "__VA_ARGS__); \
+                       return r;       \
+               } \
+       } while (0);
+
+#else
+#define SysSecureTryReturnResult(NID, condition, r, ...) \
+       do \
+       { \
+               if (unlikely(!(condition))) {   \
+                       SetLastResult(r); \
+                       return r;       \
+               } \
+       } while (0);
 #endif
 
 /**
+ * This macro allows display of exception log message with a tag and sets the last result, when the condition is @c false.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in]  NID                     The Tizen namespace
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  r                       The last result to set
+ * @param[in]   ...                    The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryReturnVoidResult(NID, condition, r, ...)   \
+       do \
+       { \
+               if (unlikely(!(condition))) {   \
+                       SysSecureLogException(NID, r, __VA_ARGS__); \
+                       return; \
+               } \
+       } while (0);
+
+/**
+ * This macro allows display of exception log message with a tag, when the condition is @c false.
+ * Executes statements, sets the last result and goes to label.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in]  NID                     The Tizen namespace
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  expr                    Expressions that are evaluated before going to CATCH label
+ * @param[in]  r                       The last result to set
+ * @param[in]   ...                    The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryCatch(NID, condition, expr, r, ...) \
+       do \
+       { \
+               if (unlikely(!(condition))) {   \
+                       SysSecureLogException(NID, r, __VA_ARGS__); \
+                       expr; \
+                       goto CATCH;     \
+               } \
+       } while (0);
+
+/**
+ * This macro allows display of exception log message with a tag, when the condition is @c false.
+ * Executes statements, sets the last result and goes to label.
+ * It allows display of exception log messages if compiled with "_SECURE_LOG" definition.
+ * Otherwise, log printing functionality will be removed in the compile time.
+ * This system log macro is for the platform modules.
+ *
+ * @since 2.1
+ *
+ * @param[in]  NID                     The Tizen namespace
+ * @param[in]  condition               The condition that is expected to be true
+ * @param[in]  expr                    Expressions that are evaluated before going to catchLabel label
+ * @param[in]  catchLabel              The label for goto operation
+ * @param[in]  r                       The last result to set
+ * @param[in]   ...                    The message to display
+ * @hideinitializer
+ */
+#define SysSecureTryCatchLabel(NID, condition, expr, catchLabel, r, ...) \
+       do \
+       { \
+               if (unlikely(!(condition))) {   \
+                       SysSecureLogException(NID, r, __VA_ARGS__); \
+                       expr; \
+                       goto catchLabel; \
+               } \
+       } while (0);
+
+
+/**
  * Defines the log ID.
  */
 enum LogID
index f43b812..d12b9e8 100644 (file)
@@ -283,6 +283,7 @@ _AppControlRegistry::LoadAliasList(void)
        if (r != E_SUCCESS)
        {
                SysLog(NID_APP, "[%s] Propagating.", GetErrorMessage(r));
+               pMap->RemoveAll(true);
                delete pMap;
                return r;
        }
@@ -304,6 +305,7 @@ _AppControlRegistry::LoadAliasList(void)
        SysLog(NID_APP, "Loading %d alias sections", __aliasAppId.GetCount());
 
 CATCH:
+       pMap->RemoveAll(true);
        delete pMap;
 
        return r;
index 20db932..579b6fe 100644 (file)
@@ -112,6 +112,9 @@ _AppInfo::~_AppInfo(void)
 {
        delete __pAppName;
        delete __pAppVersion;
+
+       // closing may or may not succeed
+       close(__appRootDirFd);
 }
 
 _AppInfo*
index fbbe888..c5111e9 100644 (file)
@@ -304,6 +304,28 @@ _AppMessageImpl::GetValueArrayN(bundle* pBundle, const char* pKey)
 }
 
 result
+_AppMessageImpl::AddValueArray(const String& key, const IList* pList)
+{
+       SysAssert(__pBundle != NULL);
+
+       return AddValueArray(__pBundle, key, pList);
+}
+
+result
+_AppMessageImpl::AddValueArraySingle(const String& key, const String& value)
+{
+       SysAssert(__pBundle != NULL);
+
+       ArrayList arr;
+       arr.Construct();
+
+       arr.Add(value);
+
+       return AddValueArray(__pBundle, key, &arr);
+}
+
+
+result
 _AppMessageImpl::AddValueArray(bundle* pBundle, const String& key, const IList* pList)
 {
        std::unique_ptr<char[]> pKey(_StringConverter::CopyToCharArrayN(key));
index 949a767..4649cc2 100644 (file)
@@ -469,8 +469,7 @@ _AppSettingImpl::GetValue(const Tizen::Base::String& id, bool& value) const
        const _SettingItem* pItem = dynamic_cast<const _SettingItem*>(pObject);
        SysTryReturnResult(NID_APP, pItem != null, E_TYPE_MISMATCH, "Type mismatch for instance of id.");
        const Boolean* pBoolean = dynamic_cast<const Boolean*>(pItem->GetValue());
-       SysTryReturnResult(NID_APP, pBoolean != null, E_TYPE_MISMATCH,
-                                          "Type mismatch between requested type bool and object type of %ls.", id.GetPointer());
+       SysTryReturnResult(NID_APP, pBoolean != null, E_TYPE_MISMATCH, "Type mismatch between requested type bool and object type.");
        value = pBoolean->ToBool();
 
        return E_SUCCESS;
@@ -484,8 +483,7 @@ _AppSettingImpl::GetValue(const Tizen::Base::String& id, int& value) const
        const _SettingItem* pItem = dynamic_cast<const _SettingItem*>(pObject);
        SysTryReturnResult(NID_APP, pItem != null, E_TYPE_MISMATCH, "Type mismatch for instance of id.");
        const Integer* pInteger = dynamic_cast<const Integer*>(pItem->GetValue());
-       SysTryReturnResult(NID_APP, pInteger != null, E_TYPE_MISMATCH,
-                                          "Type mismatch between requested type int and object type of %ls.", id.GetPointer());
+       SysTryReturnResult(NID_APP, pInteger != null, E_TYPE_MISMATCH, "Type mismatch between requested type int and object type.");
        value = pInteger->ToInt();
 
        return E_SUCCESS;
@@ -499,8 +497,7 @@ _AppSettingImpl::GetValue(const Tizen::Base::String& id, Tizen::Base::String& va
        const _SettingItem* pItem = dynamic_cast<const _SettingItem*>(pObject);
        SysTryReturnResult(NID_APP, pItem != null, E_TYPE_MISMATCH, "Type mismatch for instance of id.");
        const String* pString = dynamic_cast<const String*>(pItem->GetValue());
-       SysTryReturnResult(NID_APP, pString != null, E_TYPE_MISMATCH,
-                                          "Type mismatch between requested type String and object type of %ls.", id.GetPointer());
+       SysTryReturnResult(NID_APP, pString != null, E_TYPE_MISMATCH, "Type mismatch between requested type String and object type.");
        value = *pString;
 
        return E_SUCCESS;
@@ -514,8 +511,7 @@ _AppSettingImpl::SetValue(const Tizen::Base::String& id, bool value, bool save)
        _SettingItem* pItem = dynamic_cast<_SettingItem*>(pObject);
        SysTryReturnResult(NID_APP, pItem != null, E_TYPE_MISMATCH, "Type mismatch for instance of id.");
        Boolean* pBoolean = dynamic_cast<Boolean*>(pItem->GetValue());
-       SysTryReturnResult(NID_APP, pBoolean != null, E_TYPE_MISMATCH,
-                                          "Type mismatch between requested type bool and object type of %ls.", id.GetPointer());
+       SysTryReturnResult(NID_APP, pBoolean != null, E_TYPE_MISMATCH, "Type mismatch between requested type bool and object type.");
        *pBoolean = value;
 
        static const String strTrue(L"true");
@@ -545,8 +541,7 @@ _AppSettingImpl::SetValue(const Tizen::Base::String& id, int value, bool save)
        _SettingItem* pItem = dynamic_cast<_SettingItem*>(pObject);
        SysTryReturnResult(NID_APP, pItem != null, E_TYPE_MISMATCH, "Type mismatch for instance of id.");
        Integer* pInteger = dynamic_cast<Integer*>(pItem->GetValue());
-       SysTryReturnResult(NID_APP, pInteger != null, E_TYPE_MISMATCH,
-                                          "Type mismatch between requested type int and object type of %ls.", id.GetPointer());
+       SysTryReturnResult(NID_APP, pInteger != null, E_TYPE_MISMATCH, "Type mismatch between requested type int and object type.");
 
        SysTryReturnResult(NID_APP, (pItem->GetMin() <= value), E_OUT_OF_RANGE, "value(%d) is less than minimum range(%d).",
                                           value, pItem->GetMin());
@@ -577,8 +572,7 @@ _AppSettingImpl::SetValue(const Tizen::Base::String& id, const Tizen::Base::Stri
        _SettingItem* pItem = dynamic_cast<_SettingItem*>(pObject);
        SysTryReturnResult(NID_APP, pItem != null, E_TYPE_MISMATCH, "Type mismatch for instance of id.");
        String* pString = dynamic_cast<String*>(pItem->GetValue());
-       SysTryReturnResult(NID_APP, pString != null, E_TYPE_MISMATCH,
-                                          "Type mismatch between requested type String and object type of %ls.", id.GetPointer());
+       SysTryReturnResult(NID_APP, pString != null, E_TYPE_MISMATCH, "Type mismatch between requested type String and object type.");
 
        SysTryReturnResult(NID_APP, pItem->GetMin() <= value.GetLength(), E_OUT_OF_RANGE,
                                           "value length(%d) less than minimum length(%d).", value.GetLength(), pItem->GetMin());
@@ -1115,11 +1109,11 @@ _AppSettingImpl::SetValueFromDBusData(const char* pId, const char* pValue)
                        SetValue(strId, strValue, false);
                        return;
                }
-               SysLog(NID_APP, "Failed determin value type for id=%s", pId);
+               SysSecureLog(NID_APP, "Failed determine value type for id= %s", pId);
        }
        else
        {
-               SysLog(NID_APP, "Failed find value for id=%s", pId);
+               SysSecureLog(NID_APP, "Failed find value for id= %s", pId);
        }
 }
 
index 007650d..17d74d9 100644 (file)
@@ -73,6 +73,10 @@ public:
 
        result AddData(const Tizen::Base::Collection::IMap* pMap);
 
+       result AddValueArray(const Tizen::Base::String& key, const Tizen::Base::Collection::IList* pList);
+
+       result AddValueArraySingle(const Tizen::Base::String& key, const Tizen::Base::String& value);
+
        result RemoveData(const Tizen::Base::String& key);
 
        static result SetOperation(bundle* pBundle, const Tizen::Base::String& operation);
index 0fd3e8d..e7fb39f 100755 (executable)
@@ -371,9 +371,6 @@ _PackageManagerImpl::InstallPackage(const PackageId& packageId, const String& pa
        std::unique_ptr<char[]> pExtension(_StringConverter::CopyToCharArrayN(extension));
        SysTryReturnResult(NID_APP, pExtension, E_OUT_OF_MEMORY, "pExtension is null.");
 
-       std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(packageId));
-       SysTryReturnResult(NID_APP, pPackageId, E_OUT_OF_MEMORY, "pPackageId is null.");
-
        if ((strcasecmp(pExtension.get(), "tpk") == 0) || (strcasecmp(pExtension.get(), "wgt") == 0))
        {
                SysLog(NID_APP, "packageId = [%ls], packagePath = [%s], extension = [%s]", packageId.GetPointer(), pPackagePath.get(), pExtension.get());
@@ -384,6 +381,18 @@ _PackageManagerImpl::InstallPackage(const PackageId& packageId, const String& pa
                return E_SYSTEM;
        }
 
+       // optionalData = 12345abcde:StoreClientId=XXXXX12345.TizenStore
+       AppId StoreClientId = _AppInfo::GetApplicationId();
+       String optionalData;
+       optionalData.Append(packageId);
+       optionalData.Append(":StoreClientId=");
+       optionalData.Append(StoreClientId);
+
+       std::unique_ptr<char[]> pOptionalData(_StringConverter::CopyToCharArrayN(optionalData));
+       SysTryReturnResult(NID_APP, pOptionalData, E_OUT_OF_MEMORY, "pOptionalData is null.");
+
+       SysLog(NID_APP, "optionalData = [%s]", pOptionalData.get());
+
        result r = E_SUCCESS;
        _PackageManagerProxy packageManagerProxy;
        r = packageManagerProxy.Construct();
@@ -398,7 +407,7 @@ _PackageManagerImpl::InstallPackage(const PackageId& packageId, const String& pa
                SysTryReturnResult(NID_APP, __pRequestClient != null, E_SYSTEM, "pkgmgr_client_new(PC_REQUEST) failed");
        }
 
-       int res = pkgmgr_client_install(__pRequestClient, pExtension.get(), null, pPackagePath.get(), pPackageId.get(), PM_QUIET, InstallationEventHandler, pListener);
+       int res = pkgmgr_client_install(__pRequestClient, pExtension.get(), null, pPackagePath.get(), pOptionalData.get(), PM_QUIET, InstallationEventHandler, pListener);
 
        if (res < PKGMGR_R_OK)
        {
index 8b84873..fe00c93 100644 (file)
@@ -152,7 +152,7 @@ _DataControlResultSetImpl::FillWith(IDbEnumerator* pDbEnum)
        tempFilePath.Append(appId);
        tempFilePath.Append(callerReqId);
        __tmpPath = tempFilePath;
-       SysLog(NID_IO, "[DC_PROV_SEND] temp file path: %ls", tempFilePath.GetPointer());
+       SysSecureLog(NID_IO, "[DC_PROV_SEND] temp file path: %ls", tempFilePath.GetPointer());
 
        // initialize
        r = pDbEnum->Reset();
@@ -192,7 +192,7 @@ _DataControlResultSetImpl::FillWith(IDbEnumerator* pDbEnum)
                        GetErrorMessage(r), __tmpPath.GetPointer());
 
        columnCount = pDbEnum->GetColumnCount();
-       SysLog(NID_IO, "column count is %d.\n", columnCount);
+       SysSecureLog(NID_IO, "column count is %d.\n", columnCount);
 
        r = pFile->Seek(FILESEEKPOSITION_BEGIN, sizeof(int));
        SysTryReturn(NID_IO, r == E_SUCCESS, r, r, "[%s] System error was occurred.", GetErrorMessage(r));
@@ -266,7 +266,7 @@ _DataControlResultSetImpl::FillWith(IDbEnumerator* pDbEnum)
                byte = strlen(pColumnName);
                totalSizeOfColumnNames += byte;
 
-               SysLog(NID_IO, "[%d] column name: %s", i, pColumnName);
+               SysSecureLog(NID_IO, "[%d] column name: %s", i, pColumnName);
                delete[] pColumnName;
        }
        r = pFile->Seek(FILESEEKPOSITION_BEGIN, sizeof(int) * 2);
index 86cab34..fa6a43d 100644 (file)
@@ -683,7 +683,7 @@ _FileImpl::PrepareDataCaging(const String& appRootPath, const String& pkgId)
        bool internalInstalled = true;
        result r = E_SUCCESS;
 
-       SysLog(NID_IO, "[data_caging] PrepareDataCaging() was called by installer backend, appRootPath: %ls, packageId: %ls",
+       SysSecureLog(NID_IO, "[data_caging] PrepareDataCaging() was called by installer backend, appRootPath: %ls, packageId: %ls",
                        appRootPath.GetPointer(), pkgId.GetPointer());
 
        if (CleanDirectories(appRootPath, pkgId) == false)
index c377385..d2e32fb 100644 (file)
@@ -113,7 +113,7 @@ OnMessageReceived(int id, const char* remote_app_id, const char* remote_port, bo
        ret = messageport_get_local_port_name(id, &pLocalPort);
        if (pLocalPort == null)
        {
-               SysLog(NID_IO, "No local port for id: %d", id);
+               SysSecureLog(NID_IO, "No local port for id: %d", id);
 
                bundle_free(data);
                return;
@@ -142,7 +142,7 @@ OnMessageReceived(int id, const char* remote_app_id, const char* remote_port, bo
                }
                else // Bi-directional
                {
-                       SysLog(NID_IO, "Message received from [%s:%s], trusted: %d", remote_app_id, remote_port, trusted_port);
+                       SysSecureLog(NID_IO, "Message received from [%s:%s], trusted: %d", remote_app_id, remote_port, trusted_port);
 
                        pListener->OnMessageReceivedN(remote_app_id, remote_port, trusted_port, pMap);
                }
@@ -164,7 +164,7 @@ OnTrustedMessageReceived(int id, const char* remote_app_id, const char* remote_p
        ret = messageport_get_local_port_name(id, &pLocalPort);
        if (pLocalPort == null)
        {
-               SysLog(NID_IO, "No local port for id: %d", id);
+               SysSecureLog(NID_IO, "No local port for id: %d", id);
 
                bundle_free(data);
                return;
@@ -191,7 +191,7 @@ OnTrustedMessageReceived(int id, const char* remote_app_id, const char* remote_p
                }
                else // Bi-directional
                {
-                       SysLog(NID_IO, "Trusted message received from [%s:%s], trusted: %d", remote_app_id, remote_port, trusted_port);
+                       SysSecureLog(NID_IO, "Trusted message received from [%s:%s], trusted: %d", remote_app_id, remote_port, trusted_port);
 
                        pListener->OnMessageReceivedN(remote_app_id, remote_port, trusted_port, pMap);
                }
@@ -230,7 +230,7 @@ result
 _MessagePortProxy::RegisterMessagePort(const String& localPort,        bool isTrusted,
                                                                        const _IMessagePortListener& listener)
 {
-       SysLog(NID_IO, "Register a message port : [%ls:%ls]", __appId.GetPointer(), localPort.GetPointer());
+       SysSecureLog(NID_IO, "Register a message port : [%ls:%ls]", __appId.GetPointer(), localPort.GetPointer());
 
        result r = E_SUCCESS;
        int ret = 0;
@@ -285,7 +285,7 @@ _MessagePortProxy::RequestRemotePort(const AppId& remoteAppId,
                                                                        const String& remotePort,
                                                                        bool isTrusted)
 {
-       SysLog(NID_IO, "Request a remote message port [%ls:%ls]", remoteAppId.GetPointer(), remotePort.GetPointer());
+       SysSecureLog(NID_IO, "Request a remote message port [%ls:%ls]", remoteAppId.GetPointer(), remotePort.GetPointer());
 
        result r = E_SUCCESS;
        int ret = 0;
@@ -322,7 +322,7 @@ _MessagePortProxy::RequestRemotePort(const AppId& remoteAppId,
 result
 _MessagePortProxy::SendMessage(const AppId& remoteAppId, const String& remotePort, bool isTrusted, const HashMap* pMap)
 {
-       SysLog(NID_IO, "Send a unidirectional message to remote port [%ls:%ls]", remoteAppId.GetPointer(), remotePort.GetPointer());
+       SysSecureLog(NID_IO, "Send a unidirectional message to remote port [%ls:%ls]", remoteAppId.GetPointer(), remotePort.GetPointer());
 
        int ret = 0;
        int size = 0;
@@ -365,7 +365,7 @@ _MessagePortProxy::SendMessage(const AppId& remoteAppId, const String& remotePor
 result
 _MessagePortProxy::SendMessage(const String& localPort, bool isTrustedLocal, const AppId& remoteAppId, const String& remotePort, bool isTrustedRemote, const HashMap* pMap)
 {
-       SysLog(NID_IO, "Send a bidirectional message from [%ls:%ls] to [%ls:%ls]", __appId.GetPointer(), localPort.GetPointer(), remoteAppId.GetPointer(), remotePort.GetPointer());
+       SysSecureLog(NID_IO, "Send a bidirectional message from [%ls:%ls] to [%ls:%ls]", __appId.GetPointer(), localPort.GetPointer(), remoteAppId.GetPointer(), remotePort.GetPointer());
 
        result r = E_SUCCESS;
        int id = 0;
index 9d2abfd..65bbb9e 100644 (file)
@@ -147,7 +147,7 @@ Calendar::After(const Calendar& otherCalendar, bool& after)
                 r = E_INVALID_STATE;
         }
        SysTryReturnResult(NID_LCL, otherCalendar._pCalendarImpl, r, "Invalid argument is used. otherCalendar instance is invalid");
-       return _pCalendarImpl->After(*otherCalendar._pCalendarImpl, after);
+       return _pCalendarImpl->AfterImpl(*otherCalendar._pCalendarImpl, after);
 }
 
 result
@@ -162,7 +162,7 @@ Calendar::Before(const Calendar& otherCalendar, bool& before)
                 r = E_INVALID_STATE;
         }
        SysTryReturnResult(NID_LCL, otherCalendar._pCalendarImpl, r, "Invalid argument is used. otherCalendar instance is invalid");
-       return _pCalendarImpl->Before(*otherCalendar._pCalendarImpl, before);
+       return _pCalendarImpl->BeforeImpl(*otherCalendar._pCalendarImpl, before);
 }
 
 result
@@ -190,14 +190,14 @@ Calendar::Equals(const Object& obj) const
                return false;
        }
 
-       return _pCalendarImpl->Equals(*pOtherInstance->_pCalendarImpl);
+       return _pCalendarImpl->EqualsImpl(*pOtherInstance->_pCalendarImpl);
 }
 
 int
 Calendar::GetHashCode(void) const
 {
        SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
-       return _pCalendarImpl->GetHashCode();
+       return _pCalendarImpl->GetHashCodeImpl();
 }
 
 int
@@ -225,28 +225,28 @@ int
 Calendar::GetGreatestMinTimeField(TimeField field) const
 {
        SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
-       return _pCalendarImpl->GetGreatestMinTimeField(field);
+       return _pCalendarImpl->GetGreatestMinTimeFieldImpl(field);
 }
 
 int
 Calendar::GetLeastMaxTimeField(TimeField field) const
 {
        SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
-       return _pCalendarImpl->GetLeastMaxTimeField(field);
+       return _pCalendarImpl->GetLeastMaxTimeFieldImpl(field);
 }
 
 int
 Calendar::GetMaxTimeField(TimeField field) const
 {
        SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
-       return _pCalendarImpl->GetMaxTimeField(field);
+       return _pCalendarImpl->GetMaxTimeFieldImpl(field);
 }
 
 int
 Calendar::GetMinTimeField(TimeField field) const
 {
        SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
-       return _pCalendarImpl->GetMinTimeField(field);
+       return _pCalendarImpl->GetMinTimeFieldImpl(field);
 }
 
 int
index 226ed11..6f7ee09 100644 (file)
@@ -875,10 +875,6 @@ Locale::SetVariantCodeString(const String* pVariantCode)
 LanguageCode
 Locale::GetLanguageCode(void) const
 {
-    if ((__languageCode == LANGUAGE_INVALID) && (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1))
-       {
-        return LANGUAGE_INVALID_RESERVED;
-    }
        return __languageCode;
 }
 
@@ -886,10 +882,6 @@ Locale::GetLanguageCode(void) const
 CountryCode
 Locale::GetCountryCode(void) const
 {
-    if ((__countryCode == COUNTRY_INVALID) && (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1))
-       {
-        return COUNTRY_INVALID_RESERVED;
-    }
        return __countryCode;
 }
 
@@ -1001,12 +993,6 @@ Locale::StringToLanguageCode(const String& languageCodeString)
        LanguageCode invalidLanguageCode = LANGUAGE_INVALID;
        LanguageCode maxLangageCode = LANGUAGE_MAX;
 
-       if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
-       {
-               invalidLanguageCode =  LANGUAGE_INVALID_RESERVED;
-               maxLangageCode = LanguageMaxReserved;
-       }
-
        if (!languageCodeString.IsEmpty())
        {
                for (int i = 0; i < maxLangageCode; i++)
@@ -1032,12 +1018,6 @@ Locale::StringToCountryCode(const String& countryCodeString)
        CountryCode invalidCountryCode = COUNTRY_INVALID;
        CountryCode maxCountryCode = COUNTRY_MAX;
 
-       if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
-       {
-               invalidCountryCode = COUNTRY_INVALID_RESERVED;
-               maxCountryCode = CountryMaxReserved;
-       }
-
        if(!countryCodeString.IsEmpty())
        {
                for (int i = 0; i < maxCountryCode; i++)
@@ -1060,13 +1040,6 @@ Locale::StringToCountryCode(const String& countryCodeString)
 String
 Locale::LanguageCodeToString(LanguageCode languageCode)
 {
-    if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
-    {
-        return ((languageCode >= LANGUAGE_AAR) && (languageCode < LanguageMaxReserved))
-                ? LanguageCodeString3LetterArray[languageCode]
-                : String();
-    }
-
        return ((languageCode > LANGUAGE_INVALID) && (languageCode < LANGUAGE_MAX))
                        ? LanguageCodeString3LetterArray[languageCode]
                        : String();
@@ -1076,13 +1049,6 @@ Locale::LanguageCodeToString(LanguageCode languageCode)
 String
 Locale::CountryCodeToString(CountryCode countryCode)
 {
-    if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
-    {
-        return ((countryCode >= COUNTRY_AF) && (countryCode < CountryMaxReserved))
-                ? CountryCodeString2LetterArray[countryCode]
-                : String();
-    }
-
        return ((countryCode > COUNTRY_INVALID) && (countryCode < COUNTRY_MAX))
                   ? CountryCodeString2LetterArray[countryCode]
                   : String();
@@ -1092,13 +1058,6 @@ Locale::CountryCodeToString(CountryCode countryCode)
 String
 Locale::LanguageCodeToTwoLetterLanguageCodeString(LanguageCode languageCode)
 {
-    if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
-    {
-        return ((languageCode >= LANGUAGE_AAR) && (languageCode < LanguageMaxReserved))
-                ? _LocaleImpl::Get2LetterLanguageCodeString(LanguageCodeString3LetterArray[languageCode])
-                : String();
-    }
-
     return ((languageCode > LANGUAGE_INVALID) && (languageCode < LANGUAGE_MAX))
         ? _LocaleImpl::Get2LetterLanguageCodeString(LanguageCodeString3LetterArray[languageCode])
         : String();
@@ -1117,20 +1076,13 @@ Locale::TwoLetterLanguageCodeStringToLanguageCode(const String& languageCodeStri
                std::unique_ptr<char[]> pLangStr (_StringConverter::CopyToCharArrayN(languageCodeString));
                return StringToLanguageCode(_LocaleImpl::Get3LetterLanguageCodeString(pLangStr.get()));
        }
-       return (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1) ? LANGUAGE_INVALID_RESERVED : LANGUAGE_INVALID;
+       return LANGUAGE_INVALID;
 }
 
 
 String
 Locale::CountryCodeToThreeLetterCountryCodeString(CountryCode countryCode)
 {
-    if (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
-    {
-        return ((countryCode >= COUNTRY_AF) && (countryCode < CountryMaxReserved))
-                ? _LocaleImpl::Get3LetterCountryCodeString(CountryCodeString2LetterArray[countryCode])
-                : String();
-    }
-
     return ((countryCode > COUNTRY_INVALID) && (countryCode < COUNTRY_MAX))
             ? _LocaleImpl::Get3LetterCountryCodeString(CountryCodeString2LetterArray[countryCode])
             : String();
@@ -1142,9 +1094,7 @@ Locale::ThreeLetterCountryCodeStringToCountryCode(const String& countryCodeStrin
 {
        if (countryCodeString.GetLength() == 3)
        {
-               CountryCode maxCountryCode = (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1)
-                                        ? (CountryCode)(COUNTRY_INVALID_RESERVED - 1)
-                                        : COUNTRY_MAX;
+               CountryCode maxCountryCode = COUNTRY_MAX;
 
                for (int i = 0; i < maxCountryCode; i++)
                {
@@ -1156,7 +1106,7 @@ Locale::ThreeLetterCountryCodeStringToCountryCode(const String& countryCodeStrin
                }
        }
 
-       return (Tizen::App::_AppInfo::GetApiVersion() < _API_VERSION_2_1) ? COUNTRY_INVALID_RESERVED : COUNTRY_INVALID;
+       return COUNTRY_INVALID;
 }
 
 
index 7e991df..33f3aec 100644 (file)
@@ -321,7 +321,7 @@ _CalendarImpl::RollImpl(TimeField field, int amount)
 }
 
 result
-_CalendarImpl::After(const _CalendarImpl& otherInstance, bool& after)
+_CalendarImpl::AfterImpl(const _CalendarImpl& otherInstance, bool& after)
 {
        SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
 
@@ -337,7 +337,7 @@ _CalendarImpl::After(const _CalendarImpl& otherInstance, bool& after)
 }
 
 result
-_CalendarImpl::Before(const _CalendarImpl& otherInstance, bool& before)
+_CalendarImpl::BeforeImpl(const _CalendarImpl& otherInstance, bool& before)
 {
        SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
 
@@ -353,7 +353,7 @@ _CalendarImpl::Before(const _CalendarImpl& otherInstance, bool& before)
 }
 
 bool
-_CalendarImpl::Equals(const _CalendarImpl& otherInstance) const
+_CalendarImpl::EqualsImpl(const _CalendarImpl& otherInstance) const
 {
        if ((__pCalendar != null) && (otherInstance.__pCalendar != null))
        {
@@ -363,7 +363,7 @@ _CalendarImpl::Equals(const _CalendarImpl& otherInstance) const
 }
 
 int
-_CalendarImpl::GetHashCode(void) const
+_CalendarImpl::GetHashCodeImpl(void) const
 {
        Integer intValues = IsLenient() + GetFirstDayOfWeek() + GetMinDaysInFirstWeek();
        int hashCode = intValues.GetHashCode();
@@ -424,7 +424,7 @@ _CalendarImpl::GetTimeImpl(void) const
 }
 
 int
-_CalendarImpl::GetMinTimeField(TimeField field) const
+_CalendarImpl::GetMinTimeFieldImpl(TimeField field) const
 {
        SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
        SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
@@ -444,7 +444,7 @@ _CalendarImpl::GetActualMinTimeFieldImpl(TimeField field) const
 }
 
 int
-_CalendarImpl::GetGreatestMinTimeField(TimeField field) const
+_CalendarImpl::GetGreatestMinTimeFieldImpl(TimeField field) const
 {
        SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
        SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
@@ -454,7 +454,7 @@ _CalendarImpl::GetGreatestMinTimeField(TimeField field) const
 }
 
 int
-_CalendarImpl::GetLeastMaxTimeField(TimeField field) const
+_CalendarImpl::GetLeastMaxTimeFieldImpl(TimeField field) const
 {
        SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
        SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
@@ -474,7 +474,7 @@ _CalendarImpl::GetActualMaxTimeFieldImpl(TimeField field) const
 }
 
 int
-_CalendarImpl::GetMaxTimeField(TimeField field) const
+_CalendarImpl::GetMaxTimeFieldImpl(TimeField field) const
 {
        SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
        SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
index 2dc8f28..a07fdf6 100644 (file)
@@ -68,25 +68,25 @@ public:
        result RollImpl(TimeField field, int amount);
 
        // Methods to compare Calendars
-       result After(const _CalendarImpl& otherInstance, bool& after);
-       result Before(const _CalendarImpl& otherInstance, bool& before);
-       bool Equals(const _CalendarImpl& otherInstance) const;
+       result AfterImpl(const _CalendarImpl& otherInstance, bool& after);
+       result BeforeImpl(const _CalendarImpl& otherInstance, bool& before);
+       bool EqualsImpl(const _CalendarImpl& otherInstance) const;
 
        // Get methods
-       int GetHashCode(void) const;
+       int GetHashCodeImpl(void) const;
        CalendarType GetType(void) const;
 
        int GetTimeFieldImpl(TimeField field) const;
        result GetTimeInMillisecImpl(long long& millisec) const;
        Tizen::Base::DateTime GetTimeImpl(void) const;
 
-       int GetMinTimeField(TimeField field) const;
+       int GetMinTimeFieldImpl(TimeField field) const;
        int GetActualMinTimeFieldImpl(TimeField field) const;
-       int GetGreatestMinTimeField(TimeField field) const;
+       int GetGreatestMinTimeFieldImpl(TimeField field) const;
 
-       int GetLeastMaxTimeField(TimeField field) const;
+       int GetLeastMaxTimeFieldImpl(TimeField field) const;
        int GetActualMaxTimeFieldImpl(TimeField field) const;
-       int GetMaxTimeField(TimeField field) const;
+       int GetMaxTimeFieldImpl(TimeField field) const;
 
        int GetFirstDayOfWeekImpl(void) const;
        int GetMinDaysInFirstWeekImpl(void) const;