4 * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #ifndef __PKGMGR_INSTALLER_INFO_H__
22 #define __PKGMGR_INSTALLER_INFO_H__
24 #include <sys/types.h>
26 #include "pkgmgr_installer_type.h"
29 * @file pkgmgr_installer_info.h
30 * @brief This file declares API for getting information of pkgmgr_installer
38 * @brief Get target_uid of package which is being processed by installer
41 * @param[out] uid user id
42 * @return 0 if success, else retrun < 0
44 #include <pkgmgr_installer_info.h>
48 if (pkgmgr_installer_info_get_target_uid(&uid) < 0) {
49 printf("failed to get target uid\n");
51 printf("uid = %d\n", uid);
55 int pkgmgr_installer_info_get_target_uid(uid_t *uid);
58 * @brief Get privilege_level of package which is being processed by installer
61 * @param[out] pkgmgr_privilege_level level
62 * @return 0 if success, else retrun < 0
63 * @remark In case of uninstallation, the level can be PM_PRIVILEGE_UNKNOWN.
64 * Because, the installer don't have the privilege level in that case.
66 #include <pkgmgr_installer_info.h>
69 pkgmgr_privilege_level level;
70 if (pkgmgr_installer_info_get_privilege_level(&level) < 0) {
71 printf("failed to get privilege level\n");
73 if (level == PM_PRIVILEGE_PLATFORM)) {
74 printf("platform level privilege");
79 int pkgmgr_installer_info_get_privilege_level(pkgmgr_privilege_level *level);
82 * @brief Get debug mode flag
85 * @param[out] int debug_mode
86 * @return 0 if success, else retrun < 0
88 #include <pkgmgr_installer_info.h>
92 if (pkgmgr_installer_info_get_debug_mode(&debug_mode) < 0) {
93 printf("failed to get debug mode\n");
96 printf("debug mode is enabled");
101 int pkgmgr_installer_info_get_debug_mode(int *debug_mode);
104 * @brief Get skip optimization flag
107 * @param[out] int skip_optimization
108 * @return 0 if success, else retrun < 0
110 #include <pkgmgr_installer_info.h>
113 int skip_optimization;
114 if (pkgmgr_installer_info_get_skip_optimization(&skip_optimization) < 0) {
115 printf("failed to get skip optimization\n");
117 if (skip_optimization)) {
118 printf("skip optimization is enabled");
123 int pkgmgr_installer_info_get_skip_optimization(int *skip_optimization);
129 #endif /* __PKGMGR_INSTALLER_INFO_H__ */