• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_ERRORS_H
17 #define OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_ERRORS_H
18 
19 #include <map>
20 
21 #include "errors.h"
22 
23 namespace OHOS {
24 namespace AAFwk {
25 enum {
26     /**
27      *  Module type: Ability Manager Service side
28      */
29     ABILITY_MODULE_TYPE_SERVICE = 0,
30     /**
31      *  Module type: ABility Kit side
32      */
33     ABILITY_MODULE_TYPE_KIT = 1,
34     /**
35      *  Module type: Ability  connection state kit side
36      */
37     ABILITY_MODULE_TYPE_CONNECTION_STATE_KIT = 2
38 };
39 
40 // offset of aafwk error, only be used in this file.
41 constexpr ErrCode AAFWK_SERVICE_ERR_OFFSET = ErrCodeOffset(SUBSYS_AAFWK, ABILITY_MODULE_TYPE_SERVICE);
42 
43 enum {
44     /**
45      * Result(2097152) for StartAbility: An error of the Want could not be resolved
46      * to ability info from BMS or DistributedMS.
47      */
48     RESOLVE_ABILITY_ERR = AAFWK_SERVICE_ERR_OFFSET,
49     /**
50      * Result(2097153) for Connect: An error of the get ability service.
51      */
52     GET_ABILITY_SERVICE_FAILED,
53     /**
54      * Result(2097154) for Connect State: An error of the the ability service not connect.
55      */
56     ABILITY_SERVICE_NOT_CONNECTED,
57     /**
58      * Result(2097155) for StartAbility: An error of the Want could not be resolved
59      * to app info from BMS or DistributedMS.
60      */
61     RESOLVE_APP_ERR,
62     /**
63      * Result(2097156) for StartAbility: The ability to start is already at the top.
64      */
65     ABILITY_EXISTED,
66     /**
67      * Result(2097157) for StartAbility: An error to create mission stack.
68      */
69     CREATE_MISSION_STACK_FAILED,
70     /**
71      * Result(2097158) for StartAbility: An error to create ability record.
72      */
73     CREATE_ABILITY_RECORD_FAILED,
74     /**
75      * Result(2097159) for StartAbility: The ability to start is waiting.
76      */
77     START_ABILITY_WAITING,
78     /**
79      * Result(2097160) for TerminateAbility: Don't allow to terminate launcher.
80      */
81     TERMINATE_LAUNCHER_DENIED,
82     /**
83      * Result(2097161) for DisconnectAbility: Connection not exist.
84      */
85     CONNECTION_NOT_EXIST,
86     /**
87      * Result(2097162) for DisconnectAbility:Connection is invalid state.
88      */
89     INVALID_CONNECTION_STATE,
90     /**
91      * Result(2097163) for LoadctAbility:LoadAbility timeout.
92      */
93     LOAD_ABILITY_TIMEOUT,
94     /**
95      * Result(2097164) for DisconnectAbility:Connection timeout.
96      */
97     CONNECTION_TIMEOUT,
98     /**
99      * Result(2097165) for start service: An error of the get BundleManagerService.
100      */
101     GET_BUNDLE_MANAGER_SERVICE_FAILED,
102     /**
103      * Result(2097166) for Remove mission: An error of removing mission.
104      */
105     REMOVE_MISSION_FAILED,
106     /**
107      * Result(2097167) for All: An error occurs in server.
108      */
109     INNER_ERR,
110     /**
111      * Result(2097168) for Get recent mission: get recent missions failed
112      */
113     GET_RECENT_MISSIONS_FAILED,
114     /**
115      * Result(2097169) for Remove stack: Don't allow to remove stack which has launcher ability.
116      */
117     REMOVE_STACK_LAUNCHER_DENIED,
118     /**
119      * Result(2097170) for ConnectAbility:target ability is not service ability.
120      */
121     TARGET_ABILITY_NOT_SERVICE,
122     /**
123      * Result(2097171) for TerminateAbility:target service has a record of connect. It cannot be stopped.
124      */
125     TERMINATE_SERVICE_IS_CONNECTED,
126     /**
127      * Result(2097172) for StartAbility:The ability to start is already activating..
128      */
129     START_SERVICE_ABILITY_ACTIVATING,
130     /**
131      * Result(2097173) for move mission to top: An error of moving stack.
132      */
133     MOVE_MISSION_FAILED,
134     /**
135      * Result(2097174) for kill process: An error of kill process.
136      */
137     KILL_PROCESS_FAILED,
138     /**
139      * Result(2097175) for uninstall app: An error of uninstall app.
140      */
141     UNINSTALL_APP_FAILED,
142     /**
143      * Result(2097176) for terminate ability result: An error of terminate service.
144      */
145     TERMINATE_ABILITY_RESULT_FAILED,
146     /**
147      * Result(2097177) for check permission failed.
148      */
149     CHECK_PERMISSION_FAILED,
150 
151     /**
152      * Result(2097178) for no found abilityrecord by caller
153      */
154     NO_FOUND_ABILITY_BY_CALLER,
155 
156     /**
157      * Result(2097179) for ability visible attribute is false.
158      */
159     ABILITY_VISIBLE_FALSE_DENY_REQUEST,
160 
161     /**
162      * Result(2097180) for caller is not systemapp.
163      */
164     CALLER_ISNOT_SYSTEMAPP,
165 
166     /**
167      * Result(2097181) for get bundleName by uid fail.
168      */
169     GET_BUNDLENAME_BY_UID_FAIL,
170 
171     /**
172      * Result(2097182) for mission not found.
173      */
174     MISSION_NOT_FOUND,
175 
176     /**
177      * Result(2097183) for get bundle info fail.
178      */
179     GET_BUNDLE_INFO_FAILED,
180 
181     /**
182      * Result(2097184) for KillProcess: keep alive process can not be killed
183      */
184     KILL_PROCESS_KEEP_ALIVE,
185 
186     /**
187      * Result(2097185) for clear the application data fail.
188      */
189     CLEAR_APPLICATION_DATA_FAIL,
190 
191     // for call ability
192     /**
193      * Result(2097186) for resolve ability failed, there is no permissions
194      */
195     RESOLVE_CALL_NO_PERMISSIONS,
196 
197     /**
198      * Result(2097187) for resolve ability failed, target ability not page or singleton
199      */
200     RESOLVE_CALL_ABILITY_TYPE_ERR,
201 
202     /**
203      * Result(2097188) for resolve ability failed, resolve failed.
204      */
205     RESOLVE_CALL_ABILITY_INNER_ERR,
206 
207     /**
208      * Result(2097189) for resolve ability failed, resolve failed.
209      */
210     RESOLVE_CALL_ABILITY_VERSION_ERR,
211 
212     /**
213      * Result(2097190) for release ability failed, release failed.
214      */
215     RELEASE_CALL_ABILITY_INNER_ERR,
216 
217     /**
218      * Result(2097191) for register remote mission listener fail.
219      */
220     REGISTER_REMOTE_MISSION_LISTENER_FAIL,
221 
222     /**
223      * Result(2097192) for unregister remote mission listener fail.
224      */
225     UNREGISTER_REMOTE_MISSION_LISTENER_FAIL,
226 
227     /**
228      * Result(2097193) for invalid userid.
229      */
230     INVALID_USERID_VALUE,
231 
232     /**
233      * Result(2097194) for start user test fail.
234      */
235     START_USER_TEST_FAIL,
236 
237     /**
238      * Result(2097195) for send usr1 sig to the process of not response fail.
239      */
240     SEND_USR1_SIG_FAIL,
241 
242     /**
243      * Result(2097196) for hidump fail.
244      */
245     ERR_AAFWK_HIDUMP_ERROR,
246 
247     /**
248      * Result(2097197) for hidump params are invalid.
249      */
250     ERR_AAFWK_HIDUMP_INVALID_ARGS,
251 
252     /**
253      * Result(2097198) for parcel fail.
254      */
255     ERR_AAFWK_PARCEL_FAIL,
256 
257     /**
258      * Result(2097199) for for implicit start ability is failed.
259      */
260     ERR_IMPLICIT_START_ABILITY_FAIL,
261 
262     /**
263      * Result(2097200) for instance reach to upper limit.
264      */
265     ERR_REACH_UPPER_LIMIT,
266 
267     /**
268      * Result(2097201) for window mode.
269      */
270     ERR_AAFWK_INVALID_WINDOW_MODE,
271 
272     /**
273      * Result(2097202) for wrong interface call.
274      */
275     ERR_WRONG_INTERFACE_CALL,
276 
277     /**
278      * Result(2097203) for crowdtest expired.
279      */
280     ERR_CROWDTEST_EXPIRED,
281 
282     /**
283      * Result(2097204) for application abnormal.
284      */
285     ERR_APP_CONTROLLED,
286 
287     /**
288      * Result(2097205) for invalid caller.
289      */
290     ERR_INVALID_CALLER,
291 
292     /**
293      * Result(2097206) for not allowed continuation flag.
294      */
295     ERR_INVALID_CONTINUATION_FLAG,
296 
297     /**
298      * Result(2097207) for not allowed to cross user.
299      */
300     ERR_CROSS_USER,
301 
302     /**
303      * Result(2097208) for not granted for static permission.
304      */
305     ERR_STATIC_CFG_PERMISSION,
306 
307     /**
308      * Result(2097209) for non-system-app use system-api.
309      */
310     ERR_NOT_SYSTEM_APP,
311 
312     /**
313      * Result(2097210) for ecological rule control.
314      */
315     ERR_ECOLOGICAL_CONTROL_STATUS,
316 
317     /**
318      * Result(2097211) for app jump interceptor.
319      */
320     ERR_APP_JUMP_INTERCEPTOR_STATUS,
321 
322     /**
323      * Result(2097212) for URI flag invalid.
324      */
325     ERR_CODE_INVALID_URI_FLAG,
326 
327     /**
328      * Result(2097213) for URI type invalid.
329      */
330     ERR_CODE_INVALID_URI_TYPE,
331 
332     /**
333      * Result(2097214) for start not self application.
334      */
335     ERR_NOT_SELF_APPLICATION,
336 
337     /**
338      * Result(2097215) for edm application abnormal.
339      */
340     ERR_EDM_APP_CONTROLLED,
341 
342     /**
343      * Result(2097216) for sandbox application grant URI permission.
344      */
345     ERR_CODE_GRANT_URI_PERMISSION,
346 
347     /**
348      * Result(2097217) for collaborator is empty.
349      */
350     ERR_COLLABORATOR_NOT_REGISTER,
351 
352     /**
353      * Result(2097218) for collaborator is empty.
354      */
355     ERR_COLLABORATOR_NOTIFY_FAILED,
356 };
357 
358 enum {
359     /**
360      * Provides a list that does not contain any
361      * recent missions that currently are not available to the user.
362      */
363     RECENT_IGNORE_UNAVAILABLE = 0x0002,
364 };
365 
366 enum NativeFreeInstallError {
367     FREE_INSTALL_OK = 0,
368     /**
369      * FA search failed.
370      */
371     FA_FREE_INSTALL_QUERY_ERROR = -1,
372 
373     /**
374      * HAG query timeout.
375      */
376     HAG_QUERY_TIMEOUT = -4,
377 
378     /**
379      * FA Network unavailable.
380      */
381     FA_NETWORK_UNAVAILABLE = -2,
382 
383     /**
384      * FA internal system error.
385      */
386     FA_FREE_INSTALL_SERVICE_ERROR = 0x820101,
387 
388     /**
389      * FA distribution center crash.
390      */
391     FA_CRASH = 0x820102,
392 
393     /**
394      * FA distribution center processing timeout(30s).
395      */
396     FA_TIMEOUT = 0x820103,
397 
398     /**
399      * BMS unknown exception.
400      */
401     UNKNOWN_EXCEPTION = 0x820104,
402 
403     /**
404      * It is not supported to pull up PA across applications on the same device
405      */
406     NOT_SUPPORT_PA_ON_SAME_DEVICE = -11,
407 
408     /**
409      * FA internal system error.
410      */
411     FA_INTERNET_ERROR = -3,
412 
413     /**
414      * The user confirms to jump to the application market upgrade.
415      */
416     JUMP_TO_THE_APPLICATION_MARKET_UPGRADE = -8,
417 
418     /**
419      * User gives up.
420      */
421     USER_GIVES_UP = -7,
422 
423     /**
424      * Installation error in free installation.
425      */
426     INSTALLATION_ERROR_IN_FREE_INSTALL = -5,
427 
428     /**
429      * HAP package download timed out.
430      */
431     HAP_PACKAGE_DOWNLOAD_TIMED_OUT = -9,
432 
433     /**
434      * There are concurrent tasks, waiting for retry.
435      */
436     CONCURRENT_TASKS_WAITING_FOR_RETRY = -6,
437 
438     /**
439      * FA package does not support free installation.
440      */
441     FA_PACKAGE_DOES_NOT_SUPPORT_FREE_INSTALL = -10,
442 
443     /**
444      * The app is not allowed to pull this FA.
445      */
446     NOT_ALLOWED_TO_PULL_THIS_FA = -901,
447 
448     /**
449      * Not support cross-device free install PA
450      */
451     NOT_SUPPORT_CROSS_DEVICE_FREE_INSTALL_PA = -12,
452 
453     /**
454      * Free install timeout
455      */
456     FREE_INSTALL_TIMEOUT = 29360300,
457 
458     /**
459      * Not top ability
460      */
461     NOT_TOP_ABILITY = 0x500001,
462 
463     /**
464      * Target bundle name is not exist in targetBundleList.
465      */
466     TARGET_BUNDLE_NOT_EXIST = 0x500002,
467 
468     /**
469      * Permission denied.
470      */
471     DMS_PERMISSION_DENIED = 29360157,
472 
473     /**
474      * Result(29360176) for component access permission check failed.
475      */
476     DMS_COMPONENT_ACCESS_PERMISSION_DENIED = 29360176,
477 
478     /**
479      * Invalid parameters.
480      */
481     INVALID_PARAMETERS_ERR = 29360128,
482 
483     /**
484      * Remote DMS is not compatible.
485      */
486     REMOTE_DEVICE_NOT_COMPATIBLE = 502,
487 
488     /**
489      * Remote service's device is offline.
490      */
491     DEVICE_OFFLINE_ERR = 29360142,
492 
493     /**
494      * Result(29360175) for account access permission check failed.
495      */
496     DMS_ACCOUNT_ACCESS_PERMISSION_DENIED = 29360175,
497 
498     /**
499      * Result(29360131) for remote invalid parameters.
500      */
501     INVALID_REMOTE_PARAMETERS_ERR = 29360131,
502 
503     /*
504      * Result(29360205) for continue freeinstall failed.
505      */
506     CONTINUE_FREE_INSTALL_FAILED = 29360205,
507 
508     /**
509      * Undefine error code.
510      */
511     UNDEFINE_ERROR_CODE = 3,
512 };
513 }  // namespace AAFwk
514 }  // namespace OHOS
515 #endif  // OHOS_ABILITY_RUNTIME_ABILITY_MANAGER_ERRORS_H
516