Merge "Add store client appId for installation" into tizen_2.1
authorDuyoung Jang <duyoung.jang@samsung.com>
Wed, 17 Apr 2013 06:18:44 +0000 (15:18 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 17 Apr 2013 06:18:44 +0000 (15:18 +0900)
17 files changed:
inc/FAppAppManager.h
inc/FAppAppResource.h
inc/FAppAppSetting.h
inc/FBaseDouble.h
inc/FBaseFloat.h
src/app/CMakeLists.txt [changed mode: 0755->0644]
src/app/FApp_AppControlRegistry.cpp
src/app/FApp_AppControlResponseEvent.cpp [changed mode: 0755->0644]
src/app/FApp_AppManagerImpl.cpp [changed mode: 0644->0755]
src/base/FBaseSys.cpp
src/base/runtime/FBaseRt_EventDispatcher.cpp
src/base/runtime/FBaseRt_MainLoop.cpp
src/io/inc/FIo_IpcMessageStart.h
src/locales/FLclCalendar.cpp
src/locales/FLcl_CalendarImpl.cpp
src/locales/FLcl_CalendarImpl.h
src/security/inc/FSec_AccessControlTypes.h

index 09ab0ab..e2794b6 100755 (executable)
@@ -134,7 +134,6 @@ public:
         * @exception   E_SYSTEM                A system error has occurred. @n
         *                                                              Either the file operation or the DB operation has failed.
         * @remarks     The specific error code can be accessed using the GetLastResult() method.
-        * @remarks     For the delivered launch arguments, see App::GetAppArgumentListN().
         */
        static Tizen::Base::Collection::IList* FindAppControlsN(const Tizen::Base::String* pOperationId, const Tizen::Base::String* pCategory, const Tizen::Base::String* pDataType, const Tizen::Base::String* pUriPattern);
 
@@ -375,6 +374,7 @@ public:
         * @since       2.0
         * @privlevel   public
         * @privilege   %http://tizen.org/privilege/application.launch
+        * @feature     %http://tizen.org/feature/network.nfc for L¡±NFC=¡¯command¡¯¡± or %http://tzen.org/feature/usb.accessory for L¡±Serial=¡¯command¡¯¡± in the value of @c condition
         *
         * @return              An error code
         * @param[in]   condition         The launch condition for the application @n
@@ -406,6 +406,7 @@ public:
         * @exception   E_MAX_EXCEEDED          The size of @c pArguments has exceeded the maximum limit.
         * @exception   E_SYSTEM                                A system error has occurred.
         * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+        * @exception   E_UNSUPPORTED_OPERATION   The Emulator or target device does not support the required feature. For more information, see <a href=¡±../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm¡±>Application Filtering</a>. @b Since: @b 2.1
         *
         * @remarks             When the registered application is about to be launched, the registered launch condition and arguments are given as parameters to IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
         * @remarks             The newly introduced launch condition does not work on the previous SDK version and the E_INVALID_CONDITION exception is returned.
@@ -413,9 +414,10 @@ public:
         * @remarks             The launch period requires more consideration because an inappropriate short period value may lead
         *                              to an adverse effect on the device battery.
         * @remarks             For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of the %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
+        * @remarks     Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
         * @see                 UnregisterAppLaunch()
         * @see                 IsAppLaunchRegistered()
-        * @see                 LaunchApplication()
+        * @see                 LaunchApplication(const AppId&, LaunchOption);
         * @see                 Tizen::Base::DateTime::ToString()
         * @see                 Tizen::Io::SerialPort
         *
@@ -498,6 +500,7 @@ public:
         * @since               2.0
         * @privlevel   partner
         * @privilege   %http://tizen.org/privilege/appmanager.launch
+        * @feature     %http://tizen.org/feature/network.nfc for L¡±NFC=¡¯command¡¯¡± or %http://tzen.org/feature/usb.accessory for L¡±Serial=¡¯command¡¯¡± in the value of @c condition
         *
         * @return     An error code
         * @param[in]  appId          The ID of the application registered for launch
@@ -528,6 +531,7 @@ public:
         * @exception  E_MAX_EXCEEDED           The size of @c pArguments has exceeded the maximum limit.
         * @exception  E_SYSTEM                         A system error has occurred.
         * @exception  E_PRIVILEGE_DENIED       The application does not have the privilege to call this method.
+        * @exception    E_UNSUPPORTED_OPERATION   The Emulator or target device does not support the required feature. For more information, see <a href=¡±../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm¡±>Application Filtering</a>. @b Since: @b 2.1
         *
         * @remarks    When the registered application is about to be launched, the registered launch condition and arguments are given as parameters to IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
         * @remarks    The newly introduced launch condition does not work on the previous SDK version and the @c E_INVALID_CONDITION exception is returned.
@@ -535,9 +539,10 @@ public:
         * @remarks    The launch period requires more consideration because an inappropriate short period value may lead
         *             to an adverse effect on the device battery.
         * @remarks    For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of the %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
+        * @remarks     Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
         * @see        UnregisterAppLaunch()
         * @see        IsAppLaunchRegistered()
-        * @see        LaunchApplication()
+        * @see        LaunchApplication(const AppId&, LaunchOption);
         * @see        IAppLaunchConditionEventListener::OnAppLaunchConditionMetN()
         * @see        Tizen::Base::DateTime::ToString()
         * @see        Tizen::Io::SerialPort
index 2733816..35edf1e 100644 (file)
@@ -195,7 +195,7 @@ public:
        *
        * @since        2.0
        *
-       * @privlevel    partner
+       * @privlevel    platform
        * @privilege   %http://tizen.org/privilege/appsetting
        *
        * @return       A pointer to the %AppResource instance, @n
@@ -216,7 +216,7 @@ public:
        *
        * @since        2.0
        *
-       * @privlevel    partner
+       * @privlevel    platform
        * @privilege   %http://tizen.org/privilege/appsetting
        *
        * @return       An error code
index d5d38ca..d3832dd 100644 (file)
@@ -144,7 +144,7 @@ public:
         *
         * @since       2.0
         *
-        * @privlevel   partner
+        * @privlevel   platform
         * @privilege   %http://tizen.org/privilege/appsetting
         *
         * @return              A pointer to the %AppSetting instance, @n
@@ -167,7 +167,7 @@ public:
         *
         * @since       2.0
         *
-        * @privlevel   partner
+        * @privlevel   platform
         * @privilege   %http://tizen.org/privilege/appsetting
         *
         * @return              An error code
index 87f873c..d1b7e6f 100644 (file)
@@ -207,6 +207,7 @@ public:
         * @exception   E_SUCCESS               The method is successful.
         * @exception   E_NUM_FORMAT    The specified string does not contain a number that can be parsed.
         * @remarks             This method guarantees that the original value of out-parameter is not changed when the method returns error.
+        * @remarks             The behavior of this method is dependent on the system default locale setting.
         */
        static result Parse(const String& s, double& ret);
 
@@ -282,6 +283,7 @@ public:
         * @remarks             If the value of the current instance is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
         *                              produces the result "Infinity". @n
         *                              6 digits are given for the precision of this method. Use String::Format() to set the specific precision.
+        * @remarks             The behavior of this method is dependent on the system default locale setting.
         */
        virtual String ToString(void) const;
 
@@ -295,6 +297,7 @@ public:
         * @remarks             If the input value is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
         *                              produces the result "Infinity". @n
         *                              6 digits are given for the precision of this method. Use String::Format() to set the specific precision.
+        * @remarks             The behavior of this method is dependent on the system default locale setting.
         */
        static String ToString(double value);
 
index 041f5f4..7e2b38c 100644 (file)
@@ -195,6 +195,7 @@ public:
         *      @exception      E_SUCCESS        The method is successful.
         *      @exception      E_NUM_FORMAT The specified string does not contain a number that can be parsed.
         *      @remarks        This method guarantees that the original value of out-parameter is not changed when the method returns error.
+        *      @remarks        The behavior of this method is dependent on the system default locale setting.
         *      @see            Tizen::Base::Double::Parse()
         */
        static result Parse(const String& s, float& ret);
@@ -271,6 +272,7 @@ public:
         * @remarks             If the value is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
         *                              produces the result "Infinity". @n
         *                              6 digits are given for the precision of this method. Use String::Format() to set the specific precision.
+        * @remarks             The behavior of this method is dependent on the system default locale setting.
         */
        virtual String ToString(void) const;
 
@@ -284,6 +286,7 @@ public:
         *  @remarks    If the value is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
         *                              produces the result "Infinity". @n
         *                              6 digits are given for the precision of this method. Use String::Format() to set the specific precision.
+        * @remarks             The behavior of this method is dependent on the system default locale setting.
         */
        static String ToString(float value);
 
old mode 100755 (executable)
new mode 100644 (file)
index 5c50db4..f43b812 100644 (file)
@@ -347,12 +347,17 @@ _AppControlRegistry::GetTizenAppControlN(const String& aId, const String& oId)
                        _AppControlImpl* pImpl = _AppControlImpl::GetInstance(*pAc);
                        pImpl->SetProperty(_APPCONTROL_PROPERTY_ALIAS);
 
-                       _AppControlAliasEntry* pEntry = new (std::nothrow) _AppControlAliasEntry(aId, oId, *pAppId, *pOperation);
-                       if (pEntry)
+                       const _AppControlAliasEntry* pLookupEntry = GetReverseRuntimeAliasEntry(*pAppId, *pOperation);
+                       if (pLookupEntry == null)
                        {
-                               // may fail
-                               __runtimeAlias.Add(pEntry);
-                               SysLog(NID_APP, "Setting alias appId (%ls -> %ls).", aId.GetPointer(), pAppId->GetPointer());
+                               // no entry found : add new one
+                               _AppControlAliasEntry* pEntry = new (std::nothrow) _AppControlAliasEntry(aId, oId, *pAppId, *pOperation);
+                               if (pEntry)
+                               {
+                                       // may fail
+                                       __runtimeAlias.Add(pEntry);
+                                       SysLog(NID_APP, "Setting alias appId (%ls -> %ls).", aId.GetPointer(), pAppId->GetPointer());
+                               }
                        }
                }
                else
old mode 100755 (executable)
new mode 100644 (file)
old mode 100644 (file)
new mode 100755 (executable)
index cfc7a6a..c3d0137
@@ -67,6 +67,7 @@
 #include "FAppPkg_PackageInfoImpl.h"
 #include "FApp_AppControlManager.h"
 #include "FApp_Aul.h"
+#include "FSys_SystemInfoImpl.h"
 
 using namespace Tizen::App::Package;
 using namespace Tizen::Base;
@@ -727,6 +728,24 @@ _AppManagerImpl::RegisterAppLaunch(const AppId& appId, const String& condition,
        _ConditionManagerProxy* pProxy = GetConditionManagerProxy();
        SysTryReturnResult(NID_APP, null != pProxy, E_INVALID_STATE, "ConditionManager instance must not be null.");
 
+       Tizen::Base::Utility::StringTokenizer strTok(condition, L"=");
+       SysTryReturnResult(NID_APP, strTok.GetTokenCount() > 0, E_INVALID_ARG, "Condition string is invalid.(%ls)", condition.GetPointer());
+
+       String key;
+       result r = strTok.GetNextToken(key);
+       SysTryReturnResult(NID_APP, !IsFailed(r), E_INVALID_ARG, "Condition string is invalid.(%ls)", condition.GetPointer());
+
+       bool ret = true;
+       if (key == L"Serial")
+       {
+               r = Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/usb.accessory", ret);
+       }
+       else if (key == L"NFC")
+       {
+               r = Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/network.nfc", ret);
+       }
+       SysTryReturnResult(NID_APP, ret != false, E_UNSUPPORTED_OPERATION, "Condition(%ls)", condition.GetPointer());
+
        return pProxy->RegisterAppLaunch(appId, condition, pArguments, option);
 }
 
index 477d6b7..8fc56e5 100644 (file)
@@ -440,12 +440,12 @@ AppassertInternal(const char* pFunction, int lineNumber)
        if( (platformDebug == false) && (appDebug == 0) )
        {
                snprintf(logBody, LOG_LEN_MAX, "%s(%d) > App assertion passed due to debug mode off!", pFunction, lineNumber);
-               ALOG(LOG_ERROR, logTag, logBody);
+               ALOG(LOG_ERROR, logTag, "%s", logBody);
                return;
        }
 
        snprintf(logBody, LOG_LEN_MAX, "%s(%d) > AppAssert!", pFunction, lineNumber);
-       ALOG(LOG_ERROR, logTag, logBody);
+       ALOG(LOG_ERROR, logTag, "%s", logBody);
 
        assert(false);
 }
@@ -623,7 +623,7 @@ SysAssertInternal(const char* pFileName, int lineNumber, const char* pFunction)
 
        snprintf(logBody, LOG_LEN_MAX, "%s(%d) > SysAssert!", pFunction, lineNumber);
 
-       ALOG(LOG_ERROR, LOG_TAG_ASSERT, logBody);
+       ALOG(LOG_ERROR, LOG_TAG_ASSERT, "%s", logBody);
 
        assert(false);
 }
@@ -663,7 +663,7 @@ SysPropagateInternal(const char* pFunction, int lineNumber, unsigned long nid, r
        char logTag[LOG_MODULE_NAME_LEN_MAX];
        snprintf(logTag, LOG_MODULE_NAME_LEN_MAX, "%s", __GetModuleName(static_cast<LogID>(nid)));
 
-       ALOG(LOG_ERROR, logTag, logBody);
+       ALOG(LOG_ERROR, logTag, "%s", logBody);
 }
 
 void
index db5bec8..d1bd46d 100644 (file)
@@ -90,6 +90,9 @@ _EventDispatcher::Construct(GMainContext* pGMainContext)
        g_io_channel_set_encoding(__pEventFdIo, null, &pGError);
        g_io_channel_set_flags(__pEventFdIo, G_IO_FLAG_NONBLOCK, &pGError);
 
+       g_io_channel_set_close_on_unref(__pEventFdIo, TRUE);
+       eventFd = -1;
+
        __pEventFdSource = g_io_create_watch(__pEventFdIo, G_IO_IN);
        SysTryCatch(NID_BASE_RT, __pEventFdSource != null, r = E_SYSTEM, E_SYSTEM,
                           "[E_SYSTEM] Failed to create a gsource for a channel.");
@@ -116,6 +119,7 @@ CATCH:
 
        if (__pEventFdSource)
        {
+               g_source_destroy(__pEventFdSource);
                g_source_unref(__pEventFdSource);
                __pEventFdSource = null;
        }
@@ -126,6 +130,11 @@ CATCH:
                __pEventFdIo = null;
        }
 
+       if (eventFd != -1)
+       {
+               close(eventFd);
+       }
+
        return r;
 }
 
index 4133af8..426e52c 100644 (file)
@@ -84,6 +84,7 @@ _MainLoop::~_MainLoop(void)
 
        if (__pSource)
        {
+               g_source_destroy(__pSource);
                g_source_unref(__pSource);
                __pSource = null;
        }
@@ -114,6 +115,9 @@ _MainLoop::Construct(GMainLoop* pGmainLoop, GMainContext* pGmainContext)
        g_io_channel_set_encoding(__pChannel, null, &pGError);
        g_io_channel_set_flags(__pChannel, G_IO_FLAG_NONBLOCK, &pGError);
 
+       g_io_channel_set_close_on_unref(__pChannel, TRUE);
+       eventFd = -1;
+
        __pSource = g_io_create_watch(__pChannel, G_IO_IN);
        SysTryCatch(NID_BASE_RT, __pSource != null, r = E_SYSTEM, E_SYSTEM,
                           "[E_SYSTEM] Failed to create a gsource for a channel.");
@@ -142,6 +146,7 @@ CATCH:
 
        if (__pSource)
        {
+               g_source_destroy(__pSource);
                g_source_unref(__pSource);
                __pSource = null;
        }
@@ -152,6 +157,10 @@ CATCH:
                __pChannel = null;
        }
 
+       if (eventFd != -1)
+       {
+               close(eventFd);
+       }
        return r;
 }
 
index 98db492..4376ebc 100644 (file)
@@ -42,7 +42,8 @@ enum IpcMessageStart {
     ConnectivityNfcServiceMsgStart,
     ConnectivityTelephonyServiceMsgStart,
        UiManagerServiceStart,
-       TrustZoneServiceStart
+       TrustZoneServiceStart,
+       LockManagerServiceStart
        //LastIPCMsgStart      // Must come last.
 };
 
index 90005d9..9d2abfd 100644 (file)
@@ -204,14 +204,14 @@ int
 Calendar::GetActualMaxTimeField(TimeField field) const
 {
        SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
-       return _pCalendarImpl->GetActualMaxTimeField(field);
+       return _pCalendarImpl->GetActualMaxTimeFieldImpl(field);
 }
 
 int
 Calendar::GetActualMinTimeField(TimeField field) const
 {
        SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
-       return _pCalendarImpl->GetActualMinTimeField(field);
+       return _pCalendarImpl->GetActualMinTimeFieldImpl(field);
 }
 
 int
@@ -295,7 +295,7 @@ result
 Calendar::Roll(TimeField field, int amount)
 {
        SysAssertf(_pCalendarImpl != null, "Not yet constructed! Construct() should be called before use.");
-       return _pCalendarImpl->Roll(field, amount);
+       return _pCalendarImpl->RollImpl(field, amount);
 }
 
 result
index 8e75857..7e991df 100644 (file)
@@ -305,10 +305,9 @@ _CalendarImpl::AddTimeField(TimeField field, int amount)
 }
 
 result
-_CalendarImpl::Roll(TimeField field, int amount)
+_CalendarImpl::RollImpl(TimeField field, int amount)
 {
        SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
-
        result r = E_INVALID_ARG;
        if (Tizen::App::_AppInfo::GetApiVersion() == _API_VERSION_2_0 && Tizen::App::_AppInfo::IsOspCompat())
        {
@@ -435,7 +434,7 @@ _CalendarImpl::GetMinTimeField(TimeField field) const
 }
 
 int
-_CalendarImpl::GetActualMinTimeField(TimeField field) const
+_CalendarImpl::GetActualMinTimeFieldImpl(TimeField field) const
 {
        SysAssertf(__pCalendar != null, "Not yet constructed! Construct() should be called before use.");
        SysTryReturn(NID_LCL, ValidateTimeField(field), -1, E_INVALID_ARG,
@@ -465,7 +464,7 @@ _CalendarImpl::GetLeastMaxTimeField(TimeField field) const
 }
 
 int
-_CalendarImpl::GetActualMaxTimeField(TimeField field) const
+_CalendarImpl::GetActualMaxTimeFieldImpl(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 aafc35e..2dc8f28 100644 (file)
@@ -65,7 +65,7 @@ public:
        result ClearImpl(TimeField field);
 
        result AddTimeField(TimeField field, int amount);
-       result Roll(TimeField field, int amount);
+       result RollImpl(TimeField field, int amount);
 
        // Methods to compare Calendars
        result After(const _CalendarImpl& otherInstance, bool& after);
@@ -81,11 +81,11 @@ public:
        Tizen::Base::DateTime GetTimeImpl(void) const;
 
        int GetMinTimeField(TimeField field) const;
-       int GetActualMinTimeField(TimeField field) const;
+       int GetActualMinTimeFieldImpl(TimeField field) const;
        int GetGreatestMinTimeField(TimeField field) const;
 
        int GetLeastMaxTimeField(TimeField field) const;
-       int GetActualMaxTimeField(TimeField field) const;
+       int GetActualMaxTimeFieldImpl(TimeField field) const;
        int GetMaxTimeField(TimeField field) const;
 
        int GetFirstDayOfWeekImpl(void) const;
index aeae5c7..6ff62d8 100644 (file)
@@ -290,7 +290,7 @@ const static Tizen::Base::_ApiVisibility visibilityLevelListTable[_MAX_PRIVILEGE
        { Tizen::Base::_API_VISIBILITY_PARTNER },       // application.kill
        { Tizen::Base::_API_VISIBILITY_PUBLIC },        // application.launch
        { Tizen::Base::_API_VISIBILITY_PARTNER },       // appmanager.launch
-       { Tizen::Base::_API_VISIBILITY_PARTNER },       // appsetting
+       { Tizen::Base::_API_VISIBILITY_PLATFORM },      // appsetting
        { Tizen::Base::_API_VISIBILITY_PARTNER },       // appusage
        { Tizen::Base::_API_VISIBILITY_PARTNER },       // audiomanager.route
        { Tizen::Base::_API_VISIBILITY_PARTNER },       // audiomanager.session