Merge "Fix a fd mis-match" into tizen_2.1
authorSunwook Bae <sunwook45.bae@samsung.com>
Wed, 22 May 2013 07:07:27 +0000 (16:07 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 22 May 2013 07:07:27 +0000 (16:07 +0900)
res/x86/usr/etc/media-capability.xml
src/app/FApp_AppArg.cpp
src/app/FApp_AppImpl.cpp
src/locales/FLclLocaleManager.cpp
src/locales/FLcl_LocaleManagerImpl.cpp
src/security/FSecAccessController.cpp

index 30cccd9..cec6ede 100755 (executable)
@@ -51,9 +51,7 @@
                <value>3GP</value>\r
                <value>MP4</value>\r
        </MediaContainerType>\r
-       <Device>\r
-               <fps>50</fps>\r
-       </Device>\r
+       <AudioFps>50</AudioFps>\r
   </AudioRecorder>\r
   \r
   <Camera>\r
                <value>3GP</value>\r
                <value>MP4</value>\r
        </MediaContainerType>\r
-       <Device>\r
-               <fps>50</fps>\r
-       </Device>\r
+       <AudioFps>50</AudioFps>\r
   </VideoRecorder>\r
 \r
 </MediaCapability>\r
index c35521e..0bb0123 100755 (executable)
@@ -1031,6 +1031,7 @@ _AppArg::CreateSqlDataControlArg(bundle* b, const _SqlDataControlImpl& dc, _Data
        snprintf(dataControlRequestType, MAX_LEN_DATA_CONTROL_REQ_TYPE, "%d", static_cast<int>(requestType));
        bundle_add(b, OSP_K_DATACONTROL_REQUEST_TYPE, dataControlRequestType);
        bundle_add(b, OSP_K_DATACONTROL_PROTOCOL_VERSION, OSP_V_VERSION_2_1_0_3);
+       bundle_add(b, AUL_K_NO_CANCEL, "1");
 
        std::unique_ptr<char[]> pProvider(_StringConverter::CopyToCharArrayN(dc.__providerId));
        if (pProvider)
@@ -1056,6 +1057,7 @@ _AppArg::CreateMapDataControlArg(bundle* b, const _MapDataControlImpl& dc, _Data
        snprintf(dataControlRequestType, MAX_LEN_DATA_CONTROL_REQ_TYPE, "%d", static_cast < int >(requestType));
        bundle_add(b, OSP_K_DATACONTROL_REQUEST_TYPE, dataControlRequestType);
        bundle_add(b, OSP_K_DATACONTROL_PROTOCOL_VERSION, OSP_V_VERSION_2_1_0_3);
+       bundle_add(b, AUL_K_NO_CANCEL, "1");
 
        std::unique_ptr<char[]> pProvider(_StringConverter::CopyToCharArrayN(dc.__providerId));
        if (pProvider)
index 7b187c4..71354b5 100644 (file)
@@ -516,7 +516,7 @@ _AppImpl::HandleAppRequest(service_s* service, int req, _AppHandler handler)
 
                OnDataControlRequestReceived(*pArg, static_cast< RequestId >(req));
 
-               _AppControlManager::GetInstance()->RemoveResultRequest(req);
+               //_AppControlManager::GetInstance()->RemoveResultRequest(req);
                break;
 
        case _APP_HANDLER_LAUNCH_COND:
index f2411da..0482744 100644 (file)
@@ -87,11 +87,22 @@ IList*
 LocaleManager::GetAvailableTimeZonesN(void) const
 {
        ClearLastResult();
-       IMap* pTimeZoneMap = _LocaleManagerImpl::GetAvailableTimeZonesN();
-       IList* pTimeZoneList = pTimeZoneMap->GetKeysN();
-       pTimeZoneMap->RemoveAll();
-       delete pTimeZoneMap;    
-       return pTimeZoneList;
+       std::unique_ptr<IMap> pTimeZoneMap(_LocaleManagerImpl::GetAvailableTimeZonesN());
+       std::unique_ptr<IList> pList(pTimeZoneMap->GetKeysN());
+       std::unique_ptr<ArrayList> pArrayList(new (std::nothrow) ArrayList(SingleObjectDeleter));
+       SysTryReturn(NID_LCL, pArrayList, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+       pArrayList->Construct();
+
+       for (int i = 0; i < pList->GetCount(); i++)
+       {
+               std::unique_ptr<String> pTz(new (std::nothrow) String(*((String*)(pList->GetAt(i)))));
+               SysTryReturn(NID_LCL, pTz, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+               result r = pArrayList->Add(*(pTz.get()));
+               SysTryReturn(NID_LCL, !IsFailed(r), null, E_SYSTEM, "[E_SYSTEM] It is failed to get the tz list.");
+               pTz.release();
+       }
+       return pArrayList.release();
 }
 
 
@@ -99,11 +110,22 @@ IList*
 LocaleManager::GetAvailableTimeZonesN(int rawOffset) const
 {
        ClearLastResult();
-        IMap* pTimeZoneMap =_LocaleManagerImpl::GetAvailableTimeZonesN(rawOffset);
-        IList* pTimeZoneList = pTimeZoneMap->GetKeysN();    
-       pTimeZoneMap->RemoveAll();
-       delete pTimeZoneMap;
-        return pTimeZoneList;
+       std::unique_ptr<IMap> pTimeZoneMap(_LocaleManagerImpl::GetAvailableTimeZonesN(rawOffset));
+       std::unique_ptr<IList> pList(pTimeZoneMap->GetKeysN());
+       std::unique_ptr<ArrayList> pArrayList(new (std::nothrow) ArrayList(SingleObjectDeleter));
+       SysTryReturn(NID_LCL, pArrayList, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+       pArrayList->Construct();
+
+       for (int i = 0; i < pList->GetCount(); i++)
+       {
+               std::unique_ptr<String> pTz(new (std::nothrow) String(*((String*)(pList->GetAt(i)))));
+               SysTryReturn(NID_LCL, pTz, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+               result r = pArrayList->Add(*(pTz.get()));
+               SysTryReturn(NID_LCL, !IsFailed(r), null, E_SYSTEM, "[E_SYSTEM] It is failed to get the tz list.");
+               pTz.release();
+       }
+       return pArrayList.release();
 }
 
 TimeZone
index 86ba89d..4155f28 100644 (file)
@@ -494,19 +494,18 @@ IMap*
 _LocaleManagerImpl::GetAvailableTimeZonesN(U_ICU_NAMESPACE::StringEnumeration* pIcuTZStrList)
 {
        SysTryReturn(NID_LCL, pIcuTZStrList, null, E_SYSTEM,
-                               "[%s] The method cannot proceed due to a severe system error.",GetErrorMessage(E_SYSTEM));
+               "[%s] The method cannot proceed due to a severe system error.",GetErrorMessage(E_SYSTEM));
 
-        std::unique_ptr<HashMap, AllElementsDeleter> pTimeZoneMap(new (std::nothrow) HashMap());
-
-        SysTryReturn(NID_LCL, pTimeZoneMap, null, E_OUT_OF_MEMORY,
-                        "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
+        std::unique_ptr<HashMap> pTimeZoneMap(new (std::nothrow) HashMap(SingleObjectDeleter));
+       SysTryReturn(NID_LCL, pTimeZoneMap, null, E_OUT_OF_MEMORY,
+               "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
         pTimeZoneMap->Construct();
+
        result r = E_SUCCESS;
        int resultLength = -1;
        UErrorCode ec = U_ZERO_ERROR;
        const char* pIcuTZStr = pIcuTZStrList->next(&resultLength, ec);
-       IMap* pTZMap = GetAvailableTimeZonesN();
-
+       std::unique_ptr<IMap> pTZMap(GetAvailableTimeZonesN());
        r = GetLastResult();
        SysTryReturn(NID_LCL, pTZMap, null, r, "[%s] Fail to get available time zone list", GetErrorMessage(r));
 
@@ -520,13 +519,7 @@ _LocaleManagerImpl::GetAvailableTimeZonesN(U_ICU_NAMESPACE::StringEnumeration* p
                        std::unique_ptr< String > pDummyValue(new  (std::nothrow) String());
                        SysTryReturn(NID_LCL, pDummyValue, null, E_OUT_OF_MEMORY,"[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
                         r = pTimeZoneMap->Add(*(pTimeZone.get()), *(pDummyValue.get()));
-                       if (IsFailed(r))
-                       {
-                               pTZMap->RemoveAll();
-                               delete pTZMap;
-                               SetLastResult(E_SYSTEM);
-                               return null;
-                       }
+                       SysTryReturn(NID_LCL, !IsFailed(r), null, E_SYSTEM, "[E_SYSTEM] It is failed to add a TZ into Map.");
                        pTimeZone.release();
                        pDummyValue.release();
                }
@@ -534,8 +527,6 @@ _LocaleManagerImpl::GetAvailableTimeZonesN(U_ICU_NAMESPACE::StringEnumeration* p
                pIcuTZStr = pIcuTZStrList->next(&resultLength, ec);
        }
        SetLastResult(E_SUCCESS);
-       pTZMap->RemoveAll();
-       delete pTZMap;
        return pTimeZoneMap.release();
 }
 
@@ -547,7 +538,7 @@ _LocaleManagerImpl::GetAvailableTimeZonesN(void)
        String tzFilePath(TIMEZONE_LIST_FILE_PATH);
        result r = E_SUCCESS;
 
-       std::unique_ptr<HashMap, AllElementsDeleter> pTimeZoneMap(new (std::nothrow) HashMap());
+       std::unique_ptr<HashMap> pTimeZoneMap(new (std::nothrow) HashMap(SingleObjectDeleter));
        SysTryCatch(NID_LCL, pTimeZoneMap, null, E_OUT_OF_MEMORY,
                        "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
        r = file.Construct(tzFilePath, "r");
@@ -575,7 +566,7 @@ _LocaleManagerImpl::GetAvailableTimeZonesN(void)
                                        "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
 
                        r = pTimeZoneMap->Add(*(pTimeZone.get()), *(pDummyValue.get()));
-                       SysTryCatch(NID_LCL, r == E_SUCCESS, , r,"[%s] It is failed to add the tz into the tz map.", GetErrorMessage(r));
+                       SysTryCatch(NID_LCL, r == E_SUCCESS, , r,"[%s] It is failed to make the tz list.", GetErrorMessage(r));
                        pTimeZone.release();
                        pDummyValue.release();
                }
@@ -592,7 +583,7 @@ CATCH:
 IMap*
 _LocaleManagerImpl::GetAvailableTimeZonesFallbackN(void)
 {
-       std::unique_ptr<HashMap, AllElementsDeleter> pTimeZoneMap(new (std::nothrow) HashMap());
+       std::unique_ptr<HashMap> pTimeZoneMap(new (std::nothrow) HashMap(SingleObjectDeleter));
        SysTryReturn(NID_LCL, pTimeZoneMap, null, E_OUT_OF_MEMORY,
                        "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
 
@@ -628,7 +619,10 @@ _LocaleManagerImpl::GetAvailableTimeZonesFallbackN(void)
 IMap*
 _LocaleManagerImpl::GetAvailableTimeZonesN(int rawOffset)
 {
-       return GetAvailableTimeZonesN(U_ICU_NAMESPACE::TimeZone::createEnumeration(rawOffset * _TimeZoneImpl::ONE_MIN_IN_MILLISEC));
+       std::unique_ptr<U_ICU_NAMESPACE::StringEnumeration> pIcuTzList(U_ICU_NAMESPACE::TimeZone::createEnumeration(rawOffset * _TimeZoneImpl::ONE_MIN_IN_MILLISEC));
+       SysTryReturn(NID_LCL, pIcuTzList, null, E_SYSTEM, "[E_SYSTEM] It is failed to get Icu TZ list.");
+       IMap* pTzList =  GetAvailableTimeZonesN(pIcuTzList.get());
+       return pTzList;
 }
 
 
index 1ffd1fb..7d5b0a7 100644 (file)
@@ -253,13 +253,14 @@ AccessController::CheckPrivilege(const PackageId& packageId, const String& privi
        _PackageInfoImpl infoImpl;
        String appType;
        String webAppType(L"wgt");
+       String cAppType(L"rpm");
 
        r = _AccessController::CheckUserPrivilege(_PRV_PRIVILEGEMANAGER_READ);
        SysTryReturnResult(NID_SEC, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
 
        packageId.SubString(0, MAX_APP_ID_SIZE, subAppId);
 
-       r = infoImpl.Construct(subAppId);
+       r = infoImpl.Construct(packageId);
        SysTryReturnResult(NID_SEC, r == E_SUCCESS, E_SYSTEM, "An unexpected system error occurred.");
 
        appType = infoImpl.GetAppType();
@@ -267,6 +268,13 @@ AccessController::CheckPrivilege(const PackageId& packageId, const String& privi
        {
                return E_SUCCESS;
        }
+       else if (appType.Equals(cAppType, true))
+       {
+               r = _AccessController::CheckPrivacy(packageId, privilege);
+               SysTryReturnResult(NID_SEC, r == E_SUCCESS, E_USER_NOT_CONSENTED, "The user blocks an application from calling the method.");
+
+               return r;
+       }
 
        if (__pPrivilegeManager == null)
        {