• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_STATUS_RECEIVER_INTERFACE_H
17 #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_STATUS_RECEIVER_INTERFACE_H
18 
19 #include "iremote_broker.h"
20 
21 namespace OHOS {
22 namespace AppExecFwk {
23 class IStatusReceiver : public IRemoteBroker {
24 public:
25     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.StatusReceiver");
26 
27     /**
28      * @brief Called when install status changed, with the percentage of installation progress
29      * @param progress Indicates the percentage of the installation progress.
30      */
31     virtual void OnStatusNotify(const int progress) = 0;
32     /**
33      * @brief Called when an application is installed, updated, or uninstalled.
34      * @param resultCode Indicates the status code returned for the application installation, update, or uninstallation
35      *                   result.
36      * @param resultMsg Indicates the result message returned with the status code.
37      */
38     virtual void OnFinished(const int32_t resultCode, const std::string &resultMsg) = 0;
39 
40     virtual void SetStreamInstallId(uint32_t installerId) = 0;
41 
42     enum {
43         SUCCESS = 0,
44         ERR_INSTALL_INTERNAL_ERROR = 9568260,
45         ERR_INSTALL_HOST_INSTALLER_FAILED = 9568261,
46         ERR_INSTALL_PARSE_FAILED = 9568262,
47         ERR_INSTALL_VERSION_DOWNGRADE = 9568263,
48         ERR_INSTALL_VERIFICATION_FAILED = 9568264,
49         ERR_INSTALL_PARAM_ERROR = 9568265,
50         ERR_INSTALL_PERMISSION_DENIED = 9568266,
51         ERR_INSTALL_ENTRY_ALREADY_EXIST = 9568267,
52         ERR_INSTALL_STATE_ERROR = 9568268,
53         ERR_INSTALL_FILE_PATH_INVALID = 9568269,
54         ERR_INSTALL_INVALID_HAP_NAME = 9568270,
55         ERR_INSTALL_INVALID_BUNDLE_FILE = 9568271,
56         ERR_INSTALL_INVALID_HAP_SIZE = 9568272,
57         ERR_INSTALL_GENERATE_UID_ERROR = 9568273,
58         ERR_INSTALL_INSTALLD_SERVICE_ERROR = 9568274,
59         ERR_INSTALL_BUNDLE_MGR_SERVICE_ERROR = 9568275,
60         ERR_INSTALL_ALREADY_EXIST = 9568276,
61         ERR_INSTALL_BUNDLENAME_NOT_SAME = 9568277,
62         ERR_INSTALL_VERSIONCODE_NOT_SAME = 9568278,
63         ERR_INSTALL_VERSIONNAME_NOT_SAME = 9568279,
64         ERR_INSTALL_MINCOMPATIBLE_VERSIONCODE_NOT_SAME = 9568280,
65         ERR_INSTALL_VENDOR_NOT_SAME = 9568281,
66         ERR_INSTALL_RELEASETYPE_TARGET_NOT_SAME = 9568282,
67         ERR_INSTALL_RELEASETYPE_NOT_SAME = 9568258,
68         ERR_INSTALL_RELEASETYPE_COMPATIBLE_NOT_SAME = 9568283,
69         ERR_INSTALL_VERSION_NOT_COMPATIBLE = 9568284,
70         ERR_INSTALL_APP_DISTRIBUTION_TYPE_NOT_SAME = 9568285,
71         ERR_INSTALL_APP_PROVISION_TYPE_NOT_SAME = 9568286,
72         ERR_INSTALL_INVALID_NUMBER_OF_ENTRY_HAP = 9568287,
73         ERR_INSTALL_DISK_MEM_INSUFFICIENT = 9568288,
74         ERR_INSTALL_GRANT_REQUEST_PERMISSIONS_FAILED = 9568289,
75         ERR_INSTALL_UPDATE_HAP_TOKEN_FAILED = 9568290,
76         ERR_INSTALL_SINGLETON_NOT_SAME = 9568291,
77         ERR_INSTALL_ZERO_USER_WITH_NO_SINGLETON = 9568292,
78         ERR_INSTALL_CHECK_SYSCAP_FAILED = 9568293,
79         ERR_INSTALL_APPTYPE_NOT_SAME = 9568294,
80         ERR_INSTALL_URI_DUPLICATE = 9568295,
81         ERR_INSTALL_TYPE_ERROR = 9568296,
82         ERR_INSTALL_SDK_INCOMPATIBLE = 9568297,
83         ERR_INSTALL_SO_INCOMPATIBLE = 9568298,
84         ERR_INSTALL_AN_INCOMPATIBLE = 9568299,
85         ERR_INSTALL_NOT_UNIQUE_DISTRO_MODULE_NAME = 9568300,
86         ERR_INSTALL_INCONSISTENT_MODULE_NAME = 9568301,
87         ERR_INSTALL_SINGLETON_INCOMPATIBLE = 9568302,
88         ERR_INSTALL_DISALLOWED = 9568303,
89         ERR_INSTALL_DEVICE_TYPE_NOT_SUPPORTED = 9568304,
90         ERR_INSTALL_DEPENDENT_MODULE_NOT_EXIST = 9568305,
91         ERR_INSTALL_ASAN_ENABLED_NOT_SAME = 9568306,
92         ERR_INSTALL_ASAN_ENABLED_NOT_SUPPORT = 9568307,
93         ERR_INSTALL_BUNDLE_TYPE_NOT_SAME = 9568308,
94         ERR_INSTALL_SHARE_APP_LIBRARY_NOT_ALLOWED = 9568309,
95         ERR_INSTALL_COMPATIBLE_POLICY_NOT_SAME = 9568310,
96         ERR_APPEXECFWK_UNINSTALL_SHARE_APP_LIBRARY_IS_NOT_EXIST = 9568311,
97         ERR_APPEXECFWK_UNINSTALL_SHARE_APP_LIBRARY_IS_RELIED = 9568312,
98         ERR_APPEXECFWK_UNINSTALL_BUNDLE_IS_SHARED_LIBRARY = 9568313,
99         ERR_INSTALL_FILE_IS_SHARED_LIBRARY = 9568314,
100         ERR_INSATLL_CHECK_PROXY_DATA_URI_FAILED = 9568315,
101         ERR_INSATLL_CHECK_PROXY_DATA_PERMISSION_FAILED = 9568316,
102         ERR_INSTALL_ISOLATION_MODE_FAILED = 9568317,
103 
104         // signature errcode
105         ERR_INSTALL_FAILED_INVALID_SIGNATURE_FILE_PATH = 9568318,
106         ERR_INSTALL_FAILED_BAD_BUNDLE_SIGNATURE_FILE = 9568319,
107         ERR_INSTALL_FAILED_NO_BUNDLE_SIGNATURE = 9568320,
108         ERR_INSTALL_FAILED_VERIFY_APP_PKCS7_FAIL = 9568257,
109         ERR_INSTALL_FAILED_PROFILE_PARSE_FAIL = 9568321,
110         ERR_INSTALL_FAILED_APP_SOURCE_NOT_TRUESTED = 9568322,
111         ERR_INSTALL_FAILED_BAD_DIGEST = 9568323,
112         ERR_INSTALL_FAILED_BUNDLE_INTEGRITY_VERIFICATION_FAILURE = 9568324,
113         ERR_INSTALL_FAILED_FILE_SIZE_TOO_LARGE = 9568325,
114         ERR_INSTALL_FAILED_BAD_PUBLICKEY = 9568326,
115         ERR_INSTALL_FAILED_BAD_BUNDLE_SIGNATURE = 9568327,
116         ERR_INSTALL_FAILED_NO_PROFILE_BLOCK_FAIL = 9568328,
117         ERR_INSTALL_FAILED_BUNDLE_SIGNATURE_VERIFICATION_FAILURE = 9568329,
118         ERR_INSTALL_FAILED_VERIFY_SOURCE_INIT_FAIL = 9568330,
119         ERR_INSTALL_FAILED_INCOMPATIBLE_SIGNATURE = 9568331,
120         ERR_INSTALL_FAILED_INCONSISTENT_SIGNATURE = 9568332,
121         ERR_INSTALL_FAILED_MODULE_NAME_EMPTY = 9568333,
122         ERR_INSTALL_FAILED_MODULE_NAME_DUPLICATE = 9568334,
123         ERR_INSTALL_FAILED_CHECK_HAP_HASH_PARAM = 9568335,
124         ERR_INSTALL_FAILED_DEBUG_NOT_SAME = 9568336,
125 
126         ERR_INSTALL_PARSE_UNEXPECTED = 9568337,
127         ERR_INSTALL_PARSE_MISSING_BUNDLE = 9568338,
128         ERR_INSTALL_PARSE_MISSING_ABILITY = 9568339,
129         ERR_INSTALL_PARSE_NO_PROFILE = 9568340,
130         ERR_INSTALL_PARSE_BAD_PROFILE = 9568341,
131         ERR_INSTALL_PARSE_PROFILE_PROP_TYPE_ERROR = 9568342,
132         ERR_INSTALL_PARSE_PROFILE_MISSING_PROP = 9568259,
133         ERR_INSTALL_PARSE_PERMISSION_ERROR = 9568343,
134         ERR_INSTALL_PARSE_PROFILE_PROP_CHECK_ERROR = 9568344,
135         ERR_INSTALL_PARSE_PROFILE_PROP_SIZE_CHECK_ERROR = 9568345,
136         ERR_INSTALL_PARSE_RPCID_FAILED = 9568346,
137         ERR_INSTALL_PARSE_NATIVE_SO_FAILED = 9568347,
138         ERR_INSTALL_PARSE_AN_FAILED = 9568348,
139 
140         ERR_INSTALLD_PARAM_ERROR = 9568349,
141         ERR_INSTALLD_GET_PROXY_ERROR = 9568350,
142         ERR_INSTALLD_CREATE_DIR_FAILED = 9568351,
143         ERR_INSTALLD_CREATE_DIR_EXIST = 9568352,
144         ERR_INSTALLD_CHOWN_FAILED = 9568353,
145         ERR_INSTALLD_REMOVE_DIR_FAILED = 9568354,
146         ERR_INSTALLD_EXTRACT_FILES_FAILED = 9568355,
147         ERR_INSTALLD_RNAME_DIR_FAILED = 9568356,
148         ERR_INSTALLD_CLEAN_DIR_FAILED = 9568357,
149         ERR_INSTALLD_PERMISSION_DENIED = 9568358,
150         ERR_INSTALLD_SET_SELINUX_LABEL_FAILED = 9568359,
151 
152         // overlay installation
153         ERR_OVERLAY_INSTALLATION_FAILED_INTERNAL_ERROR = 9568360,
154         ERR_OVERLAY_INSTALLATION_FAILED_INVALID_BUNDLE_NAME = 9568361,
155         ERR_OVERLAY_INSTALLATION_FAILED_INVALID_MODULE_NAME = 9568362,
156         ERR_OVERLAY_INSTALLATION_FAILED_ERROR_HAP_TYPE = 9568363,
157         ERR_OVERLAY_INSTALLATION_FAILED_ERROR_BUNDLE_TYPE = 9568364,
158         ERR_OVERLAY_INSTALLATION_FAILED_TARGET_BUNDLE_NAME_MISSED = 9568365,
159         ERR_OVERLAY_INSTALLATION_FAILED_TARGET_MODULE_NAME_MISSED = 9568366,
160         ERR_OVERLAY_INSTALLATION_FAILED_TARGET_BUNDLE_NAME_NOT_SAME = 9568367,
161         ERR_OVERLAY_INSTALLATION_FAILED_INTERNAL_EXTERNAL_OVERLAY_EXISTED_SIMULTANEOUSLY = 9568368,
162         ERR_OVERLAY_INSTALLATION_FAILED_TARGET_PRIORITY_NOT_SAME = 9568369,
163         ERR_OVERLAY_INSTALLATION_FAILED_INVALID_PRIORITY = 9568370,
164         ERR_OVERLAY_INSTALLATION_FAILED_INCONSISTENT_VERSION_CODE = 9568371,
165         ERR_OVERLAY_INSTALLATION_FAILED_SERVICE_EXCEPTION = 9568372,
166         ERR_OVERLAY_INSTALLATION_FAILED_BUNDLE_NAME_SAME_WITH_TARGET_BUNDLE_NAME = 9568373,
167         ERR_OVERLAY_INSTALLATION_FAILED_NO_SYSTEM_APPLICATION_FOR_EXTERNAL_OVERLAY = 9568374,
168         ERR_OVERLAY_INSTALLATION_FAILED_DIFFERENT_SIGNATURE_CERTIFICATE = 9568375,
169         ERR_OVERLAY_INSTALLATION_FAILED_TARGET_BUNDLE_IS_OVERLAY_BUNDLE = 9568376,
170         ERR_OVERLAY_INSTALLATION_FAILED_TARGET_MODULE_IS_OVERLAY_MODULE = 9568377,
171         ERR_OVERLAY_INSTALLATION_FAILED_OVERLAY_TYPE_NOT_SAME = 9568378,
172         ERR_OVERLAY_INSTALLATION_FAILED_INVALID_BUNDLE_DIR = 9568379,
173 
174         ERR_UNINSTALL_SYSTEM_APP_ERROR = 9568380,
175         ERR_UNINSTALL_KILLING_APP_ERROR = 9568381,
176         ERR_UNINSTALL_INVALID_NAME = 9568382,
177         ERR_UNINSTALL_PARAM_ERROR = 9568383,
178         ERR_UNINSTALL_PERMISSION_DENIED = 9568384,
179         ERR_UNINSTALL_BUNDLE_MGR_SERVICE_ERROR = 9568385,
180         ERR_UNINSTALL_MISSING_INSTALLED_BUNDLE = 9568386,
181         ERR_UNINSTALL_MISSING_INSTALLED_MODULE = 9568387,
182         ERR_UNINSTALL_DISALLOWED = 9568388,
183         ERR_UNKNOWN = 9568389,
184 
185         ERR_FAILED_GET_INSTALLER_PROXY = 9568390,
186         ERR_FAILED_SERVICE_DIED = 9568391,
187         ERR_OPERATION_TIME_OUT = 9568392,
188 
189         ERR_INSTALL_CODE_SIGNATURE_FAILED = 9568393,
190         ERR_INSTALL_CODE_SIGNATURE_FILE_IS_INVALID = 9568394,
191 
192         ERR_UNINSTALL_FROM_BMS_EXTENSION_FAILED = 9568395,
193 
194         ERR_INSTALL_SELF_UPDATE_NOT_MDM = 9568396,
195         ERR_INSTALL_SELF_UPDATE_BUNDLENAME_NOT_SAME = 9568397,
196         ERR_INSTALL_ENTERPRISE_BUNDLE_NOT_ALLOWED = 9568398,
197 
198         ERR_RECOVER_GET_BUNDLEPATH_ERROR = 201,
199         ERR_RECOVER_INVALID_BUNDLE_NAME,
200         ERR_RECOVER_NOT_ALLOWED,
201 
202         ERR_USER_NOT_EXIST = 301,
203         ERR_USER_CREATE_FAILED,
204         ERR_USER_REMOVE_FAILED,
205         ERR_USER_NOT_INSTALL_HAP,
206     };
207 };
208 }  // namespace AppExecFwk
209 }  // namespace OHOS
210 #endif  // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_STATUS_RECEIVER_INTERFACE_H