From ce548ef0411d9e580a8cc56a19f6244fced457c4 Mon Sep 17 00:00:00 2001 From: Young Ik Cho Date: Wed, 19 Jun 2013 13:25:01 +0900 Subject: [PATCH] remove redundant functions Change-Id: Ia33fa47a2619dffc60ba5f4ea6a0c36139b25226 Signed-off-by: Young Ik Cho --- src/app/FApp_AppEntry.cpp | 95 +++---------- src/app/FApp_AppInfo.cpp | 22 +-- src/app/FApp_Aul.cpp | 341 ++-------------------------------------------- src/app/inc/FApp_Aul.h | 54 +------- 4 files changed, 42 insertions(+), 470 deletions(-) diff --git a/src/app/FApp_AppEntry.cpp b/src/app/FApp_AppEntry.cpp index 66bea11..1360497 100644 --- a/src/app/FApp_AppEntry.cpp +++ b/src/app/FApp_AppEntry.cpp @@ -44,7 +44,7 @@ #define LOG_IO_TAG "LOADER" -#define MAX_APPID 20 +#define MAX_PACKAGE_ID 20 #define MAX_APP_EXECUTABLE_NAME 230 #define MAX_PACKAGE_NAME 100 #define MAX_PR_NAME 16 @@ -180,7 +180,7 @@ GetAppIdAppExecutableNameFromPathNew(const char appName[], char* appId, char* ex } strncpy(appId, p - strlen("bin/") - 10, 10); - LOG(LOG_DEBUG, LOG_IO_TAG, "Tizen::Io, app is %s", appId); + LOG(LOG_DEBUG, LOG_IO_TAG, "Tizen::Io, package is %s", appId); return 0; } @@ -210,10 +210,10 @@ GetAppIdAppExecutableNameFromPath(const char appName[], char* appId, char* exeNa int len = end - begin - 1; - if (len > MAX_APPID) + if (len > MAX_PACKAGE_ID) { LOG(LOG_DEBUG, LOG_IO_TAG, "Tizen::Io, Improper appname %s with length %d", appName, len); - len = MAX_APPID; + len = MAX_PACKAGE_ID; //return -1; } @@ -233,18 +233,6 @@ GetAppIdAppExecutableNameFromPath(const char appName[], char* appId, char* exeNa return 0; } -static bool -GetPackageNameFromAppIdAppExecutableName(const char appId[], const char exeName[], char* pkgName, int maxPkgName) -{ - // package name is "org.tizen.[appid]#[executable]" - - //snprintf(pkgName, maxPkgName, "org.tizen.%s#%s", appId, exeName); - snprintf(pkgName, maxPkgName, "%s", appId); - - LOG(LOG_DEBUG, LOG_IO_TAG, "Tizen::App, packageName is %s", pkgName); - - return true; -} static void PrintArgs(int argc, char* argv[]) @@ -323,51 +311,10 @@ ChangeProcessName(const char* fullPath, int argc, char** const argv) } } -static int -GetDirFdFromPath(const char* pPath) -{ - int count = 0; - const int len = strlen(pPath); - char dname[PATH_MAX]; - memset(dname, 0, PATH_MAX); - - const char* p = pPath + len; - for (int i = 0; i < len; i++, p--) - { - if (*p == '/') - { - count++; - - if (count == 2) - { - goto OUT; - } - } - } - - LOG(LOG_DEBUG, LOG_IO_TAG, "Tizen::Io, %s, %d > Wrong path format : %s.", __func__, __LINE__, pPath); - - return -1; - -OUT: - strncpy(dname, pPath, p - pPath); - - const int fd = open(dname, O_RDONLY | O_CLOEXEC | O_DIRECTORY); - - LOG(LOG_DEBUG, LOG_IO_TAG, "Tizen::App, %s, %d > Directory path : %s, fd : %d.", __func__, __LINE__, dname, fd); - - return fd; -} - static void -AdjustHwAccInfo(const char* packageId, const char* execName) +AdjustHwAccInfo(const char* appId) { - char appId[MAX_APPID + MAX_APP_EXECUTABLE_NAME + 2] = {0, }; - strncpy(appId, packageId, 10); - appId[10] = '.'; - strncpy(appId + 11, execName, MAX_APP_EXECUTABLE_NAME); - pkgmgrinfo_appinfo_h appHandle = NULL; int ret = pkgmgrinfo_appinfo_get_appinfo(appId, &appHandle); if (ret != PMINFO_R_OK) @@ -413,14 +360,12 @@ main(int argc, char* pArgv[]) { bool bCommand = false; - char appId[MAX_APPID]; + char packageId[MAX_PACKAGE_ID]; char exeName[MAX_APP_EXECUTABLE_NAME]; - char packageName[MAX_PACKAGE_NAME]; char fullPath[PATH_MAX]; - memset(appId, 0, MAX_APPID); + memset(packageId, 0, MAX_PACKAGE_ID); memset(exeName, 0, MAX_APP_EXECUTABLE_NAME); - memset(packageName, 0, MAX_PACKAGE_NAME); memset(fullPath, 0, PATH_MAX); LOG(LOG_DEBUG, LOG_IO_TAG, "Tizen::Io, %s, %d > executable binary path: %s", __func__, __LINE__, pArgv[0]); @@ -439,17 +384,23 @@ main(int argc, char* pArgv[]) } LOG(LOG_DEBUG, LOG_IO_TAG, "Tizen::Io, %s, %d > processed binary path: %s", __func__, __LINE__, fullPath); - // convert package path to appId - GetAppIdAppExecutableNameFromPath(fullPath, appId, exeName); - GetPackageNameFromAppIdAppExecutableName(appId, exeName, packageName, MAX_PACKAGE_NAME); + // convert package path to packageId + GetAppIdAppExecutableNameFromPath(fullPath, packageId, exeName); + + // acquire appId from packageId and exec + char appId[MAX_PACKAGE_ID + MAX_APP_EXECUTABLE_NAME + 2] = {0, }; + strncpy(appId, packageId, 10); + appId[10] = '.'; + strncpy(appId + 11, exeName, MAX_APP_EXECUTABLE_NAME); + if (getuid() == 0) { // self caging - DoPreExec(packageName, fullPath); + DoPreExec(packageId, fullPath); // adjust privilege - AdjustPrivilege(packageName); + AdjustPrivilege(packageId); } AdjustCapability(); @@ -460,20 +411,14 @@ main(int argc, char* pArgv[]) { ChangeProcessName(fullPath, argc, pArgv); pArgv[0] = strdup(fullPath); - } - int fd = GetDirFdFromPath(pArgv[0]); - if (fd == -1) - { - LOG(LOG_DEBUG, LOG_IO_TAG, "Tizen::Io, %s, %d > Failed to open path [%d][%s].", __func__, __LINE__, getpid(), strerror(errno)); - return -1; } // dlopen will load Osp_Initialize() internally as __attribute__((constructor)) //Osp_Initialize(); - InitAppInfo(appId, exeName, argc, pArgv, fd); + InitAppInfo(packageId, exeName, argc, pArgv, -1); - AdjustHwAccInfo(appId, exeName); + AdjustHwAccInfo(appId); int r = OspMain(argc, pArgv); diff --git a/src/app/FApp_AppInfo.cpp b/src/app/FApp_AppInfo.cpp index 9f44c33..3221e86 100644 --- a/src/app/FApp_AppInfo.cpp +++ b/src/app/FApp_AppInfo.cpp @@ -44,13 +44,13 @@ using namespace Tizen::Base::Runtime; extern "C" { void _OSP_EXPORT_ -InitAppInfo(const char* appId, const char* svcId, int argc, char* pArgv[], int fd) +InitAppInfo(const char* packageId, const char* svcId, int argc, char* pArgv[], int fd) { - result r = Tizen::App::_AppInfo::GetAppInfo()->Construct(appId, svcId, argc, pArgv); + result r = Tizen::App::_AppInfo::GetAppInfo()->Construct(packageId, svcId, argc, pArgv); if (IsFailed(r)) { - SysLogException(NID_APP, E_SYSTEM, "Application initialization failure for %s.", appId); - fprintf(stderr, "Application initialization failure for %s.\n", appId); + SysLogException(NID_APP, E_SYSTEM, "Application initialization failure for %s.", packageId); + fprintf(stderr, "Application initialization failure for %s.\n", packageId); _Process::Exit(-1); } @@ -93,7 +93,7 @@ _AppInfo::_AppInfo(void) , __appRootDirFd(-1) , __appHandlerType(_APP_HANDLER_NONE) , __parentWindowHandle(-1) - , __apiVersion(_API_VERSION_2_1) + , __apiVersion(_API_VERSION_2_2) , __pAppName(null) , __pAppVersion(null) , __argc(0) @@ -126,14 +126,14 @@ _AppInfo::GetAppInfo(void) result -_AppInfo::Construct(const char* appId, const char* exeName, int argc, char* argv[]) +_AppInfo::Construct(const char* packageId, const char* exeName, int argc, char* argv[]) { - SysAssertf(appId != null, "Valid appId required to launch application."); + SysAssertf(packageId != null, "Valid appId required to launch application."); FBase_Initialize(); __appExecutableName = exeName; - __packageId = appId; + __packageId = packageId; if (__appExecutableName == L"_AppControl") { @@ -160,13 +160,13 @@ _AppInfo::Construct(const char* appId, const char* exeName, int argc, char* argv // due to possible dependency problem, FIoFile is not used // app root path first - strncpy(appInfoPath + strlen(PATH_ROOT2), appId, MAX_APPID); + strncpy(appInfoPath + strlen(PATH_ROOT2), packageId, MAX_APPID); #else // [FIXME] temporary code for directory location migration int len = strlen(PACKAGE_PATH_FORMAT2); strncpy(appInfoPath, PACKAGE_PATH_FORMAT2, len); appInfoPath[len] = '\0'; - strncpy(appInfoPath + strlen(PATH_ROOT2), appId, MAX_APPID); + strncpy(appInfoPath + strlen(PATH_ROOT2), packageId, MAX_APPID); if (euidaccess(appInfoPath, R_OK) != 0) { @@ -174,7 +174,7 @@ _AppInfo::Construct(const char* appId, const char* exeName, int argc, char* argv strncpy(appInfoPath, PACKAGE_PATH_FORMAT, len); appInfoPath[len] = '\0'; - strncpy(appInfoPath + strlen(PATH_ROOT), appId, MAX_APPID); + strncpy(appInfoPath + strlen(PATH_ROOT), packageId, MAX_APPID); } #endif // app root directory file descriptor diff --git a/src/app/FApp_Aul.cpp b/src/app/FApp_Aul.cpp index 7f20cd5..a94d145 100644 --- a/src/app/FApp_Aul.cpp +++ b/src/app/FApp_Aul.cpp @@ -46,13 +46,6 @@ #include "FApp_Aul.h" #include "FApp_TemplateUtil.h" -#ifdef __cplusplus -extern "C" { -#endif -extern int aul_listen_app_dead_signal(int (* func)(int, void*), void* data); -#ifdef __cplusplus -} -#endif using namespace Tizen::App::Package; using namespace Tizen::Base; @@ -62,15 +55,7 @@ using namespace Tizen::Base::Utility; namespace { - -const char _DESKTOP_FILE_PATH[] = "/opt/share/applications"; -const char _DESKTOP_FILE_PATH_FORMAT[] = "%s/%s.desktop"; - -const char _X_TIZEN_SVC[] = "x-tizen-svc"; //X-TIZEN-SVC=[operation1] | [URI1] | [MIME1] ; [operation2] | [URI2] | [MIME2] -const int _MAX_TIZEN_SVC_DESC_LEN = 1024; - -const int _MAX_CATEGORY = 12; -const int _MAX_PACKAGE_ID_LENGTH = 10; +const int _MAX_CATEGORY = 34; // borrowed from app-svc/include/pri_key.h #define APP_SVC_K_RES_VAL "__APP_SVC_K_RES_VAL__" @@ -83,7 +68,7 @@ namespace Tizen { namespace App struct _CategoryList { const char category[_MAX_CATEGORY]; - _AppType type; + const _AppType type; }; static const _CategoryList _CATEGORY_LIST[] = @@ -91,6 +76,9 @@ static const _CategoryList _CATEGORY_LIST[] = {"home-screen", _APP_TYPE_HOME_APP}, {"lock-screen", _APP_TYPE_LOCK_APP}, {"ime", _APP_TYPE_IME_APP}, + {"http://tizen.org/category/homeapp", _APP_TYPE_HOME_APP}, + {"http://tizen.org/category/lockapp", _APP_TYPE_LOCK_APP}, + {"http://tizen.org/category/ime", _APP_TYPE_IME_APP}, }; static const int _NUM_CATEGORY = sizeof(_CATEGORY_LIST) / sizeof(_CategoryList); @@ -148,44 +136,18 @@ _Aul::SendResult(bundle* b, appsvc_result_val res) bool -_Aul::IsRunning(const AppId& appId, const String& exeName) +_Aul::IsRunning(const String& appId) { - char slpPackageName[MAX_SLP_PACKAGE_ID] = {0, }; bool isRunning = false; - - _PackageManagerImpl* pPackageManagerImpl = _PackageManagerImpl::GetInstance(); - SysTryReturn(NID_APP, pPackageManagerImpl != null, false, E_INVALID_STATE, "[E_INVALID_STATE] Invalid package instance."); - - pPackageManagerImpl->GetPackageName(appId, &exeName, slpPackageName, MAX_SLP_PACKAGE_ID); - - app_manager_is_running(slpPackageName, &isRunning); - - SysLog(NID_APP, "'%s' %s running now.", slpPackageName, (isRunning == true) ? "is" : "is NOT"); - - return isRunning; -} - -bool -_Aul::IsRunning(const String& packageName) -{ - bool isRunning = false; - std::unique_ptr pSlpPackageName(_StringConverter::CopyToCharArrayN(packageName)); + std::unique_ptr pSlpPackageName(_StringConverter::CopyToCharArrayN(appId)); app_manager_is_running(pSlpPackageName.get(), &isRunning); - SysLog(NID_APP, "'%ls' %s running now.", packageName.GetPointer(), (isRunning) ? "is" : "is NOT"); + SysLog(NID_APP, "'%ls' %s running now.", appId.GetPointer(), (isRunning) ? "is" : "is NOT"); return isRunning; } -void -_Aul::SetOnAppTerminatedCb(int (* pf_app_dead_handler)(int pid, void* pData), void* pData) -{ - aul_listen_app_dead_signal(pf_app_dead_handler, pData); - SysLog(NID_APP, "'app_dead_handler is set."); -} - - result _Aul::TerminateApplicationByPid(int pid) { @@ -252,6 +214,8 @@ _Aul::SetPowerOffNotiListener( void (*powerOffCb)(void *pData), void *pData) return E_SUCCESS; } + +// _Aul::GetAppType is provided for installer usage int _Aul::GetAppType(const String& category) { @@ -324,289 +288,4 @@ _Aul::GetRealAppId(const AppId& appId) } } - -result -_Aul::_DesktopFile::MakePath(const AppId& appId, char* path, int size) -{ - SysTryReturnResult(NID_APP, path != null, E_INVALID_ARG, ""); - - std::unique_ptr pAppId(_StringConverter::CopyToCharArrayN(appId)); - SysTryReturnResult(NID_APP, pAppId != null, E_OUT_OF_MEMORY, "Failed to allocate memory for 'pAppId'"); - - snprintf(path, size, _DESKTOP_FILE_PATH_FORMAT, _DESKTOP_FILE_PATH, pAppId.get()); - - return E_SUCCESS; -} - -result -_Aul::_DesktopFile::UpdateService(const AppId& appId, const char* value) -{ - char path[FILENAME_MAX] = {0, }; - MakePath(appId, path, FILENAME_MAX); - - return UpdateField(path, _X_TIZEN_SVC, value); -} - - -result -_Aul::_DesktopFile::RemoveService(const AppId& appId, const char* operationOnlyValue) -{ - char path[FILENAME_MAX] = {0, }; - MakePath(appId, path, FILENAME_MAX); - - return UpdateField(path, _X_TIZEN_SVC, operationOnlyValue, true); -} - -// -// Update value of specified field. -// currently only "x-slp-svc" field is supported. -// -#define BUFFER_SIZE 1024 -result -_Aul::_DesktopFile::UpdateField(const char* path, const char* fieldName, const char* value, bool isRemove) -{ - SysTryReturnResult(NID_APP, path != null, E_INVALID_ARG, "path should not be null."); - SysTryReturnResult(NID_APP, fieldName != null, E_INVALID_ARG, "fieldName should not be null."); - SysTryReturnResult(NID_APP, value != null, E_INVALID_ARG, "value should not be null."); - - FILE* fp = fopen(path, "r+"); - SysTryReturnResult(NID_APP, fp != null, E_SYSTEM, "falied to open '%s' due to %s", path, strerror(errno)); - - char buffer[BUFFER_SIZE] = {0, }; - bool found = false; - int len = 0; - int pos = 0; - int foundpos = 0; - result r = E_SUCCESS; - int remains = 0; - - ArrayListT buffers; - buffers.Construct(); - - char* pCurrent = null; - - while (fgets(buffer, BUFFER_SIZE, fp) != NULL) - { - len = strlen(buffer); - SysTryCatch(NID_APP, len < BUFFER_SIZE, , r = E_INVALID_ARG, "strlen returns invalid value. (%d)", len ); - - if (found) - { - pCurrent = new (std::nothrow) char[len + 1]; - SysTryCatch(NID_APP, pCurrent != null, , r = E_OUT_OF_MEMORY, "failed to allocate mem pCurrent"); - - strncpy(pCurrent, buffer, len); - buffers.Add(pCurrent); - } - else - { - if (strncmp(buffer, fieldName, len) == 0) - { - int fieldNameLen = strlen(fieldName); - SysTryCatch(NID_APP, len > fieldNameLen, , E_INVALID_ARG, "[E_INVALID_ARG] fieldName(%s)", fieldName); - - pCurrent = UpdateServiceValueN(buffer + fieldNameLen, value, isRemove); - SysTryCatch(NID_APP, pCurrent != null, , r = GetLastResult(), "[%s] UpdateServiceValue failed", GetErrorMessage(GetLastResult())); - - buffers.Add(pCurrent); - - foundpos = pos; - found = true; - } - } - - pos += len; - } - - if (found) - { - fsetpos(fp, (fpos_t*) &foundpos); - - remains = buffers.GetCount(); // prevent infinite loop - while (buffers.GetCount() > 0 && remains-- > 0) - { - pCurrent = null; - buffers.GetAt(0, pCurrent); - buffers.RemoveAt(0); - SysTryCatch(NID_APP, pCurrent != null, , r = E_INVALID_STATE, ""); - - fputs(pCurrent, fp); - len = strlen(pCurrent); - pos += len; - delete[] pCurrent; - } - - int ret = truncate(path, pos); - SysTryLog(NID_APP, ret == 0, "Truncate failure (%s).", strerror(errno)); - } - else - { - char svctext[_MAX_TIZEN_SVC_DESC_LEN] = {0, }; - snprintf(svctext, _MAX_TIZEN_SVC_DESC_LEN, "%s=%s\n", fieldName, value); - fputs(svctext, fp); - } - fclose(fp); - - return E_SUCCESS; - -CATCH: - - remains = buffers.GetCount(); // prevent infinite loop - while (buffers.GetCount() > 0 && remains-- > 0) - { - pCurrent = null; - buffers.GetAt(0, pCurrent); - buffers.RemoveAt(0); - if (pCurrent != null) - { - delete[] pCurrent; - } - } - - fclose(fp); - - return r; -} - -// -// Tizen service string example -// X-TIZEN-SVC= http://tizen.org/appcontrol/operation/pick|NULL|image/jpge; http://tizen.org/appcontrol/operation/pick|NULL|video/mp4; http://tizen.org/appcontrol/operation/pick|NULL|NULL; http://tizen.org/appcontrol/operation/pview|NULL|NULL -// -char* -_Aul::_DesktopFile::UpdateServiceValueN(char* buffer, const char* newValue, bool isRemove) -{ - SysTryReturn(NID_APP, buffer != null, null, E_INVALID_ARG, ""); - SysTryReturn(NID_APP, newValue != null, null, E_INVALID_ARG, ""); - - SysLog(NID_APP, "current(%s), new(%s), isRemove(%s)", buffer, newValue, (isRemove) ? "true" : "false"); - - String buf(buffer); - bool found = false; - - const String& servicePattern(L"([A-Za-z&=:/\\.\\-]*);?"); - - ArrayList services; - String resultString; - - Utility::RegularExpression regex; - result r = regex.Construct(servicePattern); - SysTryReturn(NID_APP, !IsFailed(r), null, r, ""); - - String newOperation; - String newUrl; - String newMimeType; - String newService(newValue); - - if (isRemove == false) - { - ParseService(newService, newOperation, newUrl, newMimeType); - } - else - { - newOperation = newValue; - } - - services.Construct(); - - while (regex.Consume(buf, &services) == true) - { - String* pCurrentService = (String*) services.GetAt(1); - services.RemoveAll(false); - - String operation; - String url; - String mimeType; - - ParseService(*pCurrentService, operation, url, mimeType); - - if (operation == newOperation) - { - if (isRemove == true) - { - SysLog(NID_APP, "opreration '%ls' will be removed", operation.GetPointer()); - } - else - { - SysAssertf(found == false, "It's assumed that service doesn't have duplicated operation in tizen desktop file. But it isn't, so now we have to check this case."); - // replace operation. - if (found == false) // ( if duplicated operation is already exist, It will be keeped. - { - // update value - AppendServiceValueToString(resultString, newService); - SysLog(NID_APP, "opreration '%ls;%ls;%ls' will be updated to ;%ls;%ls", operation.GetPointer(), url.GetPointer(), mimeType.GetPointer(), newUrl.GetPointer(), mimeType.GetPointer()); - } - } - found = true; - } - else - { - // add not specified service. - AppendServiceValueToString(resultString, *pCurrentService); - } - - delete pCurrentService; - } - - if (found == false && isRemove == false) - { - AppendServiceValueToString(resultString, newService); - SysLog(NID_APP, "opreration '%ls;%ls;%ls' will be added", newOperation.GetPointer(), newUrl.GetPointer(), newMimeType.GetPointer()); - } - - SysLog(NID_APP, "updated string is '%ls'", resultString.GetPointer()); - return _StringConverter::CopyToCharArrayN(resultString); -} - - -void -_Aul::_DesktopFile::AppendServiceValueToString(String& serviceString, const String& newVaue) -{ - if (serviceString.GetLength() > 0) - { - serviceString += ";"; - } - - serviceString += newVaue; -} - - -result -_Aul::_DesktopFile::ParseService(const String& service, String& operation, String& url, String& mimeType) -{ - SysLog(NID_APP, "service(%ls)", service.GetPointer()); - - const String& serviceDetailPattern(L"([A-Za-z&=/\\.\\-]*):(.*://[A-Za-z&=/\\.\\-]*|[A-Za-z&=/\\.\\-]*):([A-Za-z&=/\\.\\-]*)"); - - Utility::RegularExpression regexDetail; - result r = regexDetail.Construct(serviceDetailPattern); - SysTryReturn(NID_APP, !IsFailed(r), null, r, "[%s] RegularExpression::Construct(L\"%ls\") failed.", GetErrorMessage(r), serviceDetailPattern.GetPointer()); - - ArrayList matchedItems; - matchedItems.Construct(); - regexDetail.Match(service, true, &matchedItems); - - int matchedCount = matchedItems.GetCount(); - SysTryLog(NID_APP, matchedCount == 4, "It's assumed that x-slp-svc value always have operation:url:mime in tizen desktop file. But it isn't or our parser is invalid. so now we have to check this case. %d", matchedItems.GetCount()); - - if (matchedCount > 1) - { - operation = *(String*) matchedItems.GetAt(1); - } - - if (matchedCount > 2) - { - url = *(String*) matchedItems.GetAt(2); - } - - if (matchedCount > 3) - { - mimeType = *(String*) matchedItems.GetAt(3); - } - - SysLog(NID_APP, "matched(%d) : (%ls;%ls;%ls)", matchedItems.GetCount(), operation.GetPointer(), url.GetPointer(), mimeType.GetPointer()); - matchedItems.RemoveAll(true); - - return E_SUCCESS; -} - } } // Tizen::App diff --git a/src/app/inc/FApp_Aul.h b/src/app/inc/FApp_Aul.h index 0d79ade..8cba1c0 100644 --- a/src/app/inc/FApp_Aul.h +++ b/src/app/inc/FApp_Aul.h @@ -49,11 +49,7 @@ public: static result SendResult(bundle* b, appsvc_result_val res); - static bool IsRunning(const AppId& appId, const Tizen::Base::String& exeName); - - static bool IsRunning(const Tizen::Base::String& packageName); - - static void SetOnAppTerminatedCb(int (* pf_app_dead_handler)(int pid, void* pData), void* pData); + static bool IsRunning(const Tizen::Base::String& appId); static result SetOomAdj(int pid, int adj); @@ -66,54 +62,6 @@ public: _OSP_LOCAL_ static AppId GetRealAppId(const AppId& appId); public: - /** - * This is static helper class for desktop file. - */ - class _DesktopFile - { - public: - /** - * Updates the service value - * @param[in] appId The application's ID to be executed - * @param[in] value value to be added or updated. - * - * @remark If operations is new, it will be appended. - * but, if same operation is already exist, 'url' and 'mimeType' will be updated. - */ - static result UpdateService(const AppId& appId, const char* value); - - /** - * Removes the service value by operation - * @param[in] appId The application's ID to be executed - * @param[in] operationOnlyValue operationId of service to be removed - */ - static result RemoveService(const AppId& appId, const char* operationOnlyValue); - - private: - /** - * Updates value of specified field - */ - static result UpdateField(const char* path, const char* key, const char* value, bool isRemove = false); - - /** - * Makes desktop file path from appId (retrives appName using _PackageMamagerImpl) - */ - static result MakePath(const AppId& appId, char* path, int size); - - /** - * Update service value of input buffer with specified value - */ - static char* UpdateServiceValueN(char* buffer, const char* newValue, bool isRemove = false); - - /** - * Extracts each informations from one service string. - */ - static result ParseService(const Tizen::Base::String& service, Tizen::Base::String& operation, Tizen::Base::String& url, Tizen::Base::String& mimeType); - - static void AppendServiceValueToString(Tizen::Base::String& string, const Tizen::Base::String& newVaue); - - friend class UTs_Aul; - }; // _DesktopFile friend class UTs_Aul; }; // _Aul -- 2.7.4