• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 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_MEDIALIBRARY_ERRNO_H
17 #define OHOS_MEDIALIBRARY_ERRNO_H
18 
19 #include <errno.h>
20 
21 namespace OHOS {
22 namespace Media {
23 #define MEDIA_LIBRARY_ERR(offset, errCode) (-((offset) + (errCode)))
24 
25 // common error code
26 // linux standard ERROR { 0, 200 }
27 constexpr int32_t E_OK = 0;
28 constexpr int32_t E_SUCCESS = 0;
29 #ifdef MEDIALIBRARY_MTP_ENABLE
30 constexpr int32_t MTP_SUCCESS = 0;
31 #endif
32 constexpr int32_t E_ERR = -1;
33 constexpr int32_t E_PERMISSION_DENIED = -EACCES;
34 constexpr int32_t E_NO_SUCH_FILE      = -ENOENT;
35 constexpr int32_t E_FILE_EXIST        = -EEXIST;
36 constexpr int32_t E_NO_MEMORY         = -ENOMEM;
37 constexpr int32_t E_NO_SPACE          = -ENOSPC;
38 constexpr int32_t E_CHECK_SYSTEMAPP_FAIL = 202;
39 
40 // medialibary inner common err { 200, 1999 }
41 constexpr int32_t E_COMMON_OFFSET = 200;
42 constexpr int32_t E_COMMON_START =          MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 0);
43 constexpr int32_t E_FAIL =                  MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 0);
44 constexpr int32_t E_FILE_OPER_FAIL =        MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 1);
45 constexpr int32_t E_USB_DISCONNECT =        MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 2);
46 constexpr int32_t E_HAS_FS_ERROR =          MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 3);
47 constexpr int32_t E_CHECK_DIR_FAIL =        MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 4);
48 constexpr int32_t E_MODIFY_DATA_FAIL =      MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 5);
49 constexpr int32_t E_INVALID_VALUES =        MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 6);
50 constexpr int32_t E_INVALID_URI =           MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 7);
51 constexpr int32_t E_INVALID_FILEID =        MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 8);
52 constexpr int32_t E_INVALID_PATH =          MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 9);
53 constexpr int32_t E_VIOLATION_PARAMETERS =  MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 10);
54 constexpr int32_t E_RENAME_DIR_FAIL  =      MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 11);
55 constexpr int32_t E_GET_VALUEBUCKET_FAIL =  MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 12);
56 constexpr int32_t E_GET_ASSET_FAIL =        MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 13);
57 constexpr int32_t E_GET_HASH_FAIL =         MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 14);
58 constexpr int32_t E_GET_CLIENTBUNDLE_FAIL = MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 15);
59 constexpr int32_t E_EXIST_IN_DB =           MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 16);
60 constexpr int32_t E_INVALID_MODE =          MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 17);
61 constexpr int32_t E_INVALID_BUNDLENAME =    MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 18);
62 constexpr int32_t E_RENAME_FILE_FAIL =      MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 19);
63 constexpr int32_t E_DB_FAIL =               MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 20);
64 constexpr int32_t E_DELETE_DENIED =         MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 21);
65 constexpr int32_t E_HAS_DB_ERROR =          MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 22);
66 constexpr int32_t E_INVALID_ARGUMENTS =     MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 23);
67 constexpr int32_t E_SQL_CHECK_FAIL =        MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 24);
68 constexpr int32_t E_IS_PENDING_ERROR =      MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 25);
69 constexpr int32_t E_NEED_FURTHER_CHECK =    MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 26);
70 constexpr int32_t E_CHECK_NATIVE_SA_FAIL =  MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 27);
71 constexpr int32_t E_INVALID_TIMESTAMP =     MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 28);
72 constexpr int32_t E_GRANT_URI_PERM_FAIL =   MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 29);
73 constexpr int32_t E_IS_IN_COMMIT =          MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 30);
74 constexpr int32_t E_IS_IN_REVERT =          MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 31);
75 constexpr int32_t E_GET_PRAMS_FAIL =        MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 32);
76 constexpr int32_t E_INVALID_MOVING_PHOTO =  MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 33);
77 constexpr int32_t E_INVALID_LIVE_PHOTO =    MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 34);
78 constexpr int32_t E_PERMISSION_DB_BYPASS =  MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 35);
79 constexpr int32_t E_PARAM_CONVERT_FORMAT =  MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 36);
80 constexpr int32_t E_INNER_CONVERT_FORMAT =  MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 37);
81 constexpr int32_t E_INNER_FAIL =            MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 38);
82 constexpr int32_t E_COMMON_END =            MEDIA_LIBRARY_ERR(E_COMMON_OFFSET, 1799);
83 
84 // medialibary directory and file type control { 2000, 2099 }
85 constexpr int32_t E_DIR_CTRL_OFFSET = 2000;
86 constexpr int32_t E_CHECK_EXTENSION_FAIL =                  MEDIA_LIBRARY_ERR(E_DIR_CTRL_OFFSET, 0);
87 constexpr int32_t E_DELETE_DIR_FAIL =                       MEDIA_LIBRARY_ERR(E_DIR_CTRL_OFFSET, 1);
88 constexpr int32_t E_CHECK_MEDIATYPE_FAIL =                  MEDIA_LIBRARY_ERR(E_DIR_CTRL_OFFSET, 2);
89 constexpr int32_t E_CHECK_ROOT_DIR_FAIL =                   MEDIA_LIBRARY_ERR(E_DIR_CTRL_OFFSET, 3);
90 constexpr int32_t E_CHECK_MEDIATYPE_MATCH_EXTENSION_FAIL =  MEDIA_LIBRARY_ERR(E_DIR_CTRL_OFFSET, 4);
91 constexpr int32_t E_FILE_NAME_INVALID =                     MEDIA_LIBRARY_ERR(E_DIR_CTRL_OFFSET, 5);
92 constexpr int32_t E_ALBUM_OPER_ERR =                        MEDIA_LIBRARY_ERR(E_DIR_CTRL_OFFSET, 6);
93 constexpr int32_t E_DIR_OPER_ERR =                          MEDIA_LIBRARY_ERR(E_DIR_CTRL_OFFSET, 7);
94 constexpr int32_t E_SAME_PATH =                             MEDIA_LIBRARY_ERR(E_DIR_CTRL_OFFSET, 8);
95 constexpr int32_t E_DIR_CHECK_DIR_FAIL =                    MEDIA_LIBRARY_ERR(E_DIR_CTRL_OFFSET, 9);
96 
97 // medialibary recycle, trash { 2100, 2199 }
98 constexpr int32_t E_TRASH_OFFSET = 2100;
99 constexpr int32_t E_RECYCLE_FILE_IS_NULL = MEDIA_LIBRARY_ERR(E_TRASH_OFFSET, 0);
100 constexpr int32_t E_IS_RECYCLED =          MEDIA_LIBRARY_ERR(E_TRASH_OFFSET, 1);
101 constexpr int32_t E_RECYCLE_DIR_FAIL =     MEDIA_LIBRARY_ERR(E_TRASH_OFFSET, 2);
102 constexpr int32_t E_CREATE_TRASHDIR_FAIL = MEDIA_LIBRARY_ERR(E_TRASH_OFFSET, 3);
103 constexpr int32_t E_MAKE_HASHNAME_FAIL =   MEDIA_LIBRARY_ERR(E_TRASH_OFFSET, 4);
104 constexpr int32_t E_GET_EXTENSION_FAIL =   MEDIA_LIBRARY_ERR(E_TRASH_OFFSET, 5);
105 
106 
107 // medialibary distributed { 2200, 2299 }
108 constexpr int32_t E_DISTRIBUTED_OFFSET = 2200;
109 constexpr int32_t E_DEVICE_OPER_ERR = MEDIA_LIBRARY_ERR(E_DISTRIBUTED_OFFSET, 0);
110 
111 // medialibary thumbanail { 2300, 2399 }
112 constexpr int32_t E_THUMBNAIL_OFFSET = 2300;
113 constexpr int32_t E_THUMBNAIL_CONNECT_TIMEOUT = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 0);
114 constexpr int32_t E_THUMBNAIL_HAS_OPENED_FAIL = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 1);
115 constexpr int32_t E_THUMBNAIL_LOCAL_CREATE_FAIL = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 2);
116 constexpr int32_t E_THUMBNAIL_REMOTE_CREATE_FAIL = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 3);
117 constexpr int32_t E_THUMBNAIL_SERVICE_NULLPTR = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 4);
118 constexpr int32_t E_THUMBNAIL_INVALID_SIZE = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 5);
119 constexpr int32_t E_THUMBNAIL_UNKNOWN = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 6);
120 constexpr int32_t E_THUMBNAIL_ASTC_ALL_EXIST = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 7);
121 constexpr int32_t E_THUMBNAIL_LCD_ALL_EXIST = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 8);
122 constexpr int32_t E_CLOUD_THUMBNAIL_NOT_DOWNLOAD_FINISH = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 9);
123 constexpr int32_t E_CLOUD_NOT_SUITABLE_FOR_TASK = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 10);
124 constexpr int32_t E_FREE_SIZE_NOT_ENOUGH = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 11);
125 constexpr int32_t E_RDB_UPDATE_NO_ROWS_CHANGED = MEDIA_LIBRARY_ERR(E_THUMBNAIL_OFFSET, 12);
126 
127 // medialibary scanner { 2400, 2499 }
128 constexpr int32_t E_SCANNER_OFFSET = 2400;
129 constexpr int32_t E_FILE_HIDDEN = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 0);
130 constexpr int32_t E_DIR_HIDDEN = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 1);
131 constexpr int32_t E_RDB = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 2);
132 constexpr int32_t E_DATA = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 3);
133 constexpr int32_t E_SYSCALL = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 4);
134 constexpr int32_t E_SCANNED = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 5);
135 constexpr int32_t E_AVMETADATA = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 6);
136 constexpr int32_t E_IMAGE = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 7);
137 constexpr int32_t E_NO_RESULT = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 8);
138 constexpr int32_t E_STOP = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 9);
139 constexpr int32_t E_IS_PENDING = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 10);
140 constexpr int32_t E_MOVING_PHOTO = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 11);
141 constexpr int32_t E_NO_THUMB = MEDIA_LIBRARY_ERR(E_SCANNER_OFFSET, 12);
142 
143 // media file extension module error code { 3000, 3099 }
144 constexpr int32_t E_MEDIA_FILE_OFFSET = 3000;
145 constexpr int32_t E_URI_INVALID =               MEDIA_LIBRARY_ERR(E_MEDIA_FILE_OFFSET, 0);
146 constexpr int32_t E_DISTIBUTED_URI_NO_SUPPORT = MEDIA_LIBRARY_ERR(E_MEDIA_FILE_OFFSET, 1);
147 constexpr int32_t E_URI_IS_NOT_ALBUM =          MEDIA_LIBRARY_ERR(E_MEDIA_FILE_OFFSET, 2);
148 constexpr int32_t E_URI_IS_NOT_FILE =           MEDIA_LIBRARY_ERR(E_MEDIA_FILE_OFFSET, 3);
149 constexpr int32_t E_TWO_URI_ARE_THE_SAME =      MEDIA_LIBRARY_ERR(E_MEDIA_FILE_OFFSET, 4);
150 constexpr int32_t E_OPENFILE_INVALID_FLAG =     MEDIA_LIBRARY_ERR(E_MEDIA_FILE_OFFSET, 5);
151 constexpr int32_t E_INVALID_DISPLAY_NAME =      MEDIA_LIBRARY_ERR(E_MEDIA_FILE_OFFSET, 6);
152 constexpr int32_t E_DENIED_MOVE =               MEDIA_LIBRARY_ERR(E_MEDIA_FILE_OFFSET, 7);
153 constexpr int32_t E_UPDATE_DB_FAIL =            MEDIA_LIBRARY_ERR(E_MEDIA_FILE_OFFSET, 8);
154 constexpr int32_t E_DENIED_RENAME =             MEDIA_LIBRARY_ERR(E_MEDIA_FILE_OFFSET, 9);
155 
156 #ifdef MEDIALIBRARY_MTP_ENABLE
157 // common error {14000, 14099}
158 constexpr int32_t E_MTP_COMMON_OFFSET = 14000;
159 constexpr int32_t MTP_FAIL =                            MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 0);
160 constexpr int32_t MTP_ERROR_SESSION_ALREADY_OPEN =      MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 1);
161 constexpr int32_t MTP_ERROR_CONTEXT_IS_NULL =           MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 2);
162 constexpr int32_t MTP_ERROR_PACKET_INCORRECT =          MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 3);
163 constexpr int32_t MTP_ERROR_NO_THIS_FILE =              MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 4);
164 constexpr int32_t MTP_ERROR_INCOMPLETE_TRANSFER =       MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 5);
165 constexpr int32_t MTP_ERROR_SESSION_NOT_OPEN =          MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 6);
166 constexpr int32_t MTP_ERROR_INVALID_STORAGE_ID =        MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 7);
167 constexpr int32_t MTP_ERROR_INVALID_OBJECTHANDLE =      MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 8);
168 constexpr int32_t MTP_ERROR_DEVICEPROP_NOT_SUPPORTED =  MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 9);
169 constexpr int32_t MTP_ERROR_DRIVER_OPEN_FAILED =        MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 10);
170 constexpr int32_t MTP_ERROR_TRANSFER_CANCELLED =        MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 11);
171 constexpr int32_t MTP_ERROR_RESPONSE_GENERAL =          MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 12);
172 constexpr int32_t MTP_ERROR_TRANSFER_FAILED =           MEDIA_LIBRARY_ERR(E_MTP_COMMON_OFFSET, 13);
173 
174 // medialibrary error { 15000, 15099 }
175 constexpr int32_t E_MTP_MEDIALIBRARY_OFFSET = 15000;
176 constexpr int32_t MTP_ERROR_STORE_NOT_AVAILABLE =       MEDIA_LIBRARY_ERR(E_MTP_MEDIALIBRARY_OFFSET, 0);
177 constexpr int32_t MTP_ERROR_NO_THUMBNAIL_PRESENT =      MEDIA_LIBRARY_ERR(E_MTP_MEDIALIBRARY_OFFSET, 1);
178 constexpr int32_t MTP_ERROR_INVALID_PARENTOBJECT =      MEDIA_LIBRARY_ERR(E_MTP_MEDIALIBRARY_OFFSET, 2);
179 constexpr int32_t MTP_ERROR_PARAMETER_NOT_SUPPORTED =   MEDIA_LIBRARY_ERR(E_MTP_MEDIALIBRARY_OFFSET, 3);
180 constexpr int32_t MTP_ERROR_INVALID_OBJECTPROP_VALUE =  MEDIA_LIBRARY_ERR(E_MTP_MEDIALIBRARY_OFFSET, 4);
181 constexpr int32_t MTP_ERROR_INVALID_OBJECTPROP_FORMAT = MEDIA_LIBRARY_ERR(E_MTP_MEDIALIBRARY_OFFSET, 5);
182 constexpr int32_t MTP_ERROR_INVALID_OBJECTPROPCODE =    MEDIA_LIBRARY_ERR(E_MTP_MEDIALIBRARY_OFFSET, 6);
183 constexpr int32_t MTP_ERROR_ACCESS_DENIED =             MEDIA_LIBRARY_ERR(E_MTP_MEDIALIBRARY_OFFSET, 7);
184 constexpr int32_t MTP_ERROR_SPECIFICATION_BY_GROUP_UNSUPPORTED = MEDIA_LIBRARY_ERR(E_MTP_MEDIALIBRARY_OFFSET, 8);
185 constexpr int32_t MTP_ERROR_SPECIFICATION_BY_DEPTH_UNSUPPORTED = MEDIA_LIBRARY_ERR(E_MTP_MEDIALIBRARY_OFFSET, 9);
186 constexpr int32_t MTP_STORE_READ_ONLY =                 MEDIA_LIBRARY_ERR(E_MTP_MEDIALIBRARY_OFFSET, 10);
187 #endif
188 
189 // media smart album module error code { 4000, 4099 }
190 constexpr int32_t E_MEDIA_SMART_OFFSET = 4000;
191 constexpr int32_t E_PARENT_SMARTALBUM_IS_NOT_EXISTED = MEDIA_LIBRARY_ERR(E_MEDIA_SMART_OFFSET, 0);
192 constexpr int32_t E_PARENT_SMARTALBUM_CAN_NOT_DELETE = MEDIA_LIBRARY_ERR(E_MEDIA_SMART_OFFSET, 1);
193 constexpr int32_t E_DELETE_SMARTALBUM_MAP_FAIL =       MEDIA_LIBRARY_ERR(E_MEDIA_SMART_OFFSET, 2);
194 constexpr int32_t E_SMARTALBUM_IS_NOT_EXISTED =        MEDIA_LIBRARY_ERR(E_MEDIA_SMART_OFFSET, 3);
195 constexpr int32_t E_CHILD_CAN_NOT_ADD_SMARTALBUM =     MEDIA_LIBRARY_ERR(E_MEDIA_SMART_OFFSET, 4);
196 constexpr int32_t E_TRASHALBUM_CAN_NOT_DELETE =        MEDIA_LIBRARY_ERR(E_MEDIA_SMART_OFFSET, 5);
197 constexpr int32_t E_FAVORITEALBUM_CAN_NOT_DELETE =     MEDIA_LIBRARY_ERR(E_MEDIA_SMART_OFFSET, 6);
198 constexpr int32_t E_PARENT_CAN_NOT_ADDASSETS =         MEDIA_LIBRARY_ERR(E_MEDIA_SMART_OFFSET, 7);
199 
200 // media cloud sync error code { 5000, 5099 }
201 constexpr int32_t E_MEDIA_CLOUD_SYNC_OFFSET = 5000;
202 constexpr int32_t E_CLOUDID_IS_NOT_NULL =               MEDIA_LIBRARY_ERR(E_MEDIA_CLOUD_SYNC_OFFSET, 0);
203 constexpr int32_t E_QUERY_CONTENT_IS_EMPTY =            MEDIA_LIBRARY_ERR(E_MEDIA_CLOUD_SYNC_OFFSET, 1);
204 constexpr int32_t E_PATH_QUERY_FILED =                  MEDIA_LIBRARY_ERR(E_MEDIA_CLOUD_SYNC_OFFSET, 2);
205 constexpr int32_t E_CLOUD_SYNC_DATA =                   MEDIA_LIBRARY_ERR(E_MEDIA_CLOUD_SYNC_OFFSET, 3);
206 constexpr int32_t E_HANDLE_GENERAL_FAILED =             MEDIA_LIBRARY_ERR(E_MEDIA_CLOUD_SYNC_OFFSET, 4);
207 constexpr int32_t E_MEDIA_CLOUD_ARGS_INVAILD =          MEDIA_LIBRARY_ERR(E_MEDIA_CLOUD_SYNC_OFFSET, 5);
208 
209 constexpr int32_t E_CLOUDSYNC_INVAL_ARG =               MEDIA_LIBRARY_ERR(E_MEDIA_CLOUD_SYNC_OFFSET, 6);
210 constexpr int32_t E_CLOUDSYNC_RDB_QUERY_FAILED =        MEDIA_LIBRARY_ERR(E_MEDIA_CLOUD_SYNC_OFFSET, 7);
211 constexpr int32_t E_CLOUDSYNC_RDB_UPDATE_FAILED =       MEDIA_LIBRARY_ERR(E_MEDIA_CLOUD_SYNC_OFFSET, 8);
212 constexpr int32_t E_CLOUDSYNC_RDB_DELETE_FAILED =       MEDIA_LIBRARY_ERR(E_MEDIA_CLOUD_SYNC_OFFSET, 9);
213 constexpr int32_t E_RDB_STORE_NULL =                    MEDIA_LIBRARY_ERR(E_MEDIA_CLOUD_SYNC_OFFSET, 10);
214 constexpr int32_t E_RESULT_SET_NULL =                   MEDIA_LIBRARY_ERR(E_MEDIA_CLOUD_SYNC_OFFSET, 11);
215 
216 // media on notify module error code { 16000, 16099 }
217 constexpr int32_t E_MEDIA_NOTIFY_OFFSET = 16000;
218 constexpr int32_t E_ASYNC_WORKER_IS_NULL =             MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 0);
219 constexpr int32_t E_NOTIFY_TASK_DATA_IS_NULL =         MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 1);
220 constexpr int32_t E_SOLVE_URIS_FAILED =                MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 2);
221 constexpr int32_t E_NOTIFY_CHANGE_EXT_FAILED =         MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 3);
222 constexpr int32_t E_PARCEL_GET_SIZE_FAILED =           MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 4);
223 constexpr int32_t E_GET_ALBUM_ID_FAILED =              MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 5);
224 constexpr int32_t E_DO_NOT_NEDD_SEND_NOTIFY =          MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 6);
225 constexpr int32_t E_DATAOBSERVER_IS_NULL =             MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 7);
226 constexpr int32_t E_OBSERVER_CALLBACK_RECIPIENT_ERROR = MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 8);
227 constexpr int32_t E_URI_NOT_EXIST =                    MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 9);
228 constexpr int32_t E_DATAOBSERVER_IS_REPEATED =         MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 10);
229 constexpr int32_t E_URI_IS_INVALID =                   MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 11);
230 constexpr int32_t E_OBSERVER_MANAGER_IS_NULL =         MEDIA_LIBRARY_ERR(E_MEDIA_NOTIFY_OFFSET, 12);
231 
232 // media on custom restore error code { 17000, 17099 }
233 constexpr int32_t E_MEDIA_CUSTOM_RESTORE_OFFSET = 17000;
234 constexpr int32_t E_DATASHARE_IS_NULL =                MEDIA_LIBRARY_ERR(E_MEDIA_CUSTOM_RESTORE_OFFSET, 0);
235 constexpr int32_t E_CALLBACK_IS_NULL =                 MEDIA_LIBRARY_ERR(E_MEDIA_CUSTOM_RESTORE_OFFSET, 1);
236 constexpr int32_t E_OBSERVER_IS_NULL =                 MEDIA_LIBRARY_ERR(E_MEDIA_CUSTOM_RESTORE_OFFSET, 2);
237 constexpr int32_t E_DATA_OBS_MGR_CLIENT_IS_NULL =      MEDIA_LIBRARY_ERR(E_MEDIA_CUSTOM_RESTORE_OFFSET, 3);
238 
239 // media IPC error code { 18000, 18099 }
240 constexpr int32_t E_MEDIA_IPC_OFFSET = 18000;
241 constexpr int32_t E_IPC_ERR = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 0);
242 constexpr int32_t E_IPC_SEVICE_DIED = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 1);
243 constexpr int32_t E_IPC_RECEIVE_FAILED = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 2);
244 constexpr int32_t E_IPC_SEND_FAILED = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 3);
245 constexpr int32_t E_IPC_INVAL_ARG = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 4);
246 constexpr int32_t E_IPC_BROKEN_IPC = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 5);
247 constexpr int32_t E_IPC_SA_LOAD_FAILED = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 6);
248 constexpr int32_t E_IPC_SERVICE_DESCRIPTOR_IS_EMPTY = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 7);
249 constexpr int32_t E_IPC_PERMISSION_DENIED = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 8);
250 constexpr int32_t E_IPC_PERMISSION_SYSTEM = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 9);
251 constexpr int32_t E_IPC_GET_TOKEN_INFO_ERROR = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 10);
252 constexpr int32_t E_IPC_NUM_OUT_OF_RANGE = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 11);
253 constexpr int32_t E_IPC_SEVICE_NOT_FOUND = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 12);
254 constexpr int32_t E_IPC_SEVICE_MARSHALLING_FAIL = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 13);
255 constexpr int32_t E_IPC_SEVICE_UNMARSHALLING_FAIL = MEDIA_LIBRARY_ERR(E_MEDIA_IPC_OFFSET, 14);
256 
257 // CloudSyncServiceErrCode
258 constexpr int32_t E_INVAL_ARG = 2;
259 constexpr int32_t E_NETWORK_NOT_AVAILABLE = 13;
260 constexpr int32_t E_SYNC_STOP = 24;
261 constexpr int32_t E_UNKNOWN = 31;
262 constexpr int32_t E_CLOUD_STORAGE_FULL = 32;
263 constexpr int32_t E_LOCAL_STORAGE_FULL = 33;
264 } // namespace Media
265 } // namespace OHOS
266 #endif // OHOS_MEDIALIBRARY_ERRNO_H