2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
20 * @brief This is the header file of the _Aul class.
23 #ifndef _FAPP_INTERNAL_AUL_H_
24 #define _FAPP_INTERNAL_AUL_H_
26 #include <appsvc/appsvc.h>
28 #include <FOspConfig.h>
29 #include <FAppTypes.h>
31 #define MAX_SLP_PACKAGE_ID 128
33 namespace Tizen { namespace App
38 * @brief SysDep class for AppManager
40 * @final This class it not intended for extension.
42 class _OSP_EXPORT_ _Aul
45 static result GetConvertedResult(const int aul_ret, const char* pFunctionName);
47 static result TerminateApplication(const AppId& appId);
49 static result TerminateApplicationByPid(int pid);
51 static result SendResult(bundle* b, appsvc_result_val res);
53 static bool IsRunning(const AppId& appId, const Tizen::Base::String& exeName);
55 static bool IsRunning(const Tizen::Base::String& packageName);
57 static void SetOnAppTerminatedCb(int (* pf_app_dead_handler)(int pid, void* pData), void* pData);
59 static result SetOomAdj(int pid, int adj);
61 static result SetPowerOffNotiListener(void (*powerOffCb)(void *pData), void *pData);
63 static int GetAppType(const Tizen::Base::String& category);
65 static bool IsInstalled(const AppId& appId);
69 * This is static helper class for desktop file.
75 * Updates the service value
76 * @param[in] appId The application's ID to be executed
77 * @param[in] value value to be added or updated.
79 * @remark If operations is new, it will be appended.
80 * but, if same operation is already exist, 'url' and 'mimeType' will be updated.
82 static result UpdateService(const AppId& appId, const char* value);
85 * Removes the service value by operation
86 * @param[in] appId The application's ID to be executed
87 * @param[in] operationOnlyValue operationId of service to be removed
89 static result RemoveService(const AppId& appId, const char* operationOnlyValue);
93 * Updates value of specified field
95 static result UpdateField(const char* path, const char* key, const char* value, bool isRemove = false);
98 * Makes desktop file path from appId (retrives appName using _PackageMamagerImpl)
100 static result MakePath(const AppId& appId, char* path, int size);
103 * Update service value of input buffer with specified value
105 static char* UpdateServiceValueN(char* buffer, const char* newValue, bool isRemove = false);
108 * Extracts each informations from one service string.
110 static result ParseService(const Tizen::Base::String& service, Tizen::Base::String& operation, Tizen::Base::String& url, Tizen::Base::String& mimeType);
112 static void AppendServiceValueToString(Tizen::Base::String& string, const Tizen::Base::String& newVaue);
114 friend class UTs_Aul;
117 friend class UTs_Aul;
122 #endif // _FAPP_INTERNAL_AUL_H_