1 /* 2 * Copyright (C) 2021-2024 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 INTERFACES_INNERKITS_NATIVE_INCLUDE_MEDIA_DATA_ABILITY_CONST_H_ 17 #define INTERFACES_INNERKITS_NATIVE_INCLUDE_MEDIA_DATA_ABILITY_CONST_H_ 18 19 #include <map> 20 21 #include "medialibrary_type_const.h" 22 #include "media_column.h" 23 #include "userfilemgr_uri.h" 24 25 namespace OHOS { 26 namespace Media { 27 28 const int32_t MEDIA_RDB_VERSION = 150; 29 30 enum { 31 VERSION_ADD_CLOUD = 2, 32 VERSION_ADD_META_MODIFED = 3, 33 VERSION_MODIFY_SYNC_STATUS = 4, 34 VERSION_ADD_API10_TABLE = 5, 35 VERSION_MODIFY_DELETE_TRIGGER = 6, 36 VERSION_ADD_CLOUD_VERSION = 7, 37 VERSION_UPDATE_CLOUD_PATH = 8, 38 VERSION_UPDATE_API10_TABLE = 9, 39 VERSION_ADD_TABLE_TYPE = 10, 40 VERSION_ADD_PACKAGE_NAME = 11, 41 VERSION_ADD_CLOUD_ALBUM = 12, 42 VERSION_ADD_CAMERA_SHOT_KEY = 13, 43 /** 44 * Remove album count triggers for batch operation performance, 45 * update PhotoAlbum.count by a query and an update(in a single transaction of course) 46 * if number of assets in an album changes. 47 */ 48 VERSION_REMOVE_ALBUM_COUNT_TRIGGER = 14, 49 VERSION_ADD_ALL_EXIF = 15, 50 VERSION_ADD_UPDATE_CLOUD_SYNC_TRIGGER = 16, 51 VERSION_ADD_YEAR_MONTH_DAY = 17, 52 VERSION_UPDATE_YEAR_MONTH_DAY = 18, 53 VERSION_ADD_PHOTO_EDIT_TIME = 21, 54 VERSION_ADD_VISION_TABLE = 22, 55 VERSION_FIX_INDEX_ORDER = 23, 56 VERSION_ADD_SHOOTING_MODE = 24, 57 VERSION_ADD_HIDDEN_VIEW_COLUMNS = 25, 58 VERSION_ADD_HIDDEN_TIME = 26, 59 VERSION_ADD_LAST_VISIT_TIME = 27, 60 VERSION_ADD_LOCATION_TABLE = 29, 61 VERSION_ADD_ALBUM_ORDER = 30, 62 VERSION_ADD_FACE_TABLE = 31, 63 VERSION_ADD_VISION_ALBUM = 32, 64 VERSION_ADD_SOURCE_ALBUM_TRIGGER = 33, 65 VERSION_FIX_DOCS_PATH = 34, 66 VERSION_ADD_SEARCH_TABLE = 35, 67 VERSION_ADD_FORM_MAP = 36, 68 VERSION_ADD_IMAGE_VIDEO_COUNT = 37, 69 VERSION_ADD_PHOTO_CLEAN_FLAG_AND_THUMB_STATUS = 38, 70 VERSION_ADD_AESTHETIC_COMPOSITION_TABLE = 39, 71 VERSION_ADD_SCHPT_HIDDEN_TIME_INDEX = 40, 72 VERSION_ADD_SALIENCY_TABLE = 41, 73 VERSION_CLEAR_LABEL_DATA = 42, 74 VERSION_REOMOVE_SOURCE_ALBUM_TO_ANALYSIS = 43, 75 VERSION_ADD_SHOOTING_MODE_TAG = 44, 76 VERSION_ADD_PORTRAIT_IN_ALBUM = 45, 77 VERSION_UPDATE_GEO_TABLE = 46, 78 VERSION_ADD_MULTISTAGES_CAPTURE = 47, 79 VERSION_UPDATE_DATE_TO_MILLISECOND = 48, 80 VERSION_ADD_ADDRESS_DESCRIPTION = 49, 81 VERSION_ADD_HAS_ASTC = 50, 82 VERSION_UPDATE_SPEC_FOR_ADD_SCREENSHOT = 51, 83 VERSION_MOVE_SOURCE_ALBUM_TO_PHOTO_ALBUM_AND_ADD_COLUMNS = 52, 84 VERSION_ADD_CLOUD_ID_INDEX = 54, 85 VERSION_UPDATE_PHOTOS_MDIRTY_TRIGGER = 55, 86 VERSION_ALBUM_REFRESH = 56, 87 VERSION_ADD_FAVORITE_INDEX = 57, 88 VERSION_MODIFY_SOURCE_ALBUM_TRIGGERS = 58, 89 VERSION_ADD_MISSING_UPDATES = 59, 90 VERSION_ADD_IS_LOCAL_ALBUM = 60, 91 VERSION_ADD_HEAD_AND_POSE_TABLE = 61, 92 VERSION_UPDATE_SEARCH_INDEX = 62, 93 VERSION_ADD_SEGMENTATION_COLUMNS = 63, 94 VERSION_ADD_STOYR_TABLE = 64, 95 VERSION_UPDATE_MDIRTY_TRIGGER_FOR_SDIRTY = 65, 96 VERSION_SHOOTING_MODE_CLOUD = 66, 97 VERSION_ADD_OWNER_APPID = 67, 98 VERSION_ADD_VIDEO_LABEL_TABEL = 68, 99 VERSION_CREATE_PHOTOS_EXT_TABLE = 69, 100 VERSION_ADD_IS_COVER_SATISFIED_COLUMN = 70, 101 VERSION_UPDATE_VIDEO_LABEL_TABEL = 71, 102 VERSION_MOVE_KVDB = 72, 103 VERSION_ADD_DYNAMIC_RANGE_TYPE = 73, 104 VERSION_UPDATE_PHOTO_ALBUM_BUNDLENAME = 74, 105 VERSION_UPDATE_PHOTO_ALBUM_TIGGER = 75, 106 VERSION_ADD_THUMB_LCD_SIZE_COLUMN = 76, 107 VERSION_UPDATE_HIGHLIGHT_TABLE_PRIMARY_KEY = 77, 108 VERSION_UPDATE_VISION_TRIGGER_FOR_VIDEO_LABEL = 78, 109 VERSION_ADD_FACE_OCCLUSION_AND_POSE_TYPE_COLUMN = 79, 110 VERSION_ADD_MOVING_PHOTO_EFFECT_MODE = 80, 111 VERSION_ADD_IS_TEMP = 81, 112 VERSION_ADD_OWNER_APPID_TO_FILES_TABLE = 82, 113 VERSION_ADD_IS_TEMP_TO_TRIGGER = 83, 114 VERSION_UPDATE_PHOTO_THUMBNAIL_READY = 84, 115 PHOTOS_CREATE_DISPLAYNAME_INDEX = 85, 116 VERSION_UPDATE_ANALYSIS_TABLES = 86, 117 VERSION_ADD_COVER_POSITION = 87, 118 VERSION_ADD_SCHPT_READY_INEDX = 88, 119 VERSION_UPDATE_SOURCE_ALBUM_AND_ALBUM_BUNDLENAME_TRIGGERS = 89, 120 VERSION_ADD_FRONT_CAMERA_TYPE = 90, 121 VERSION_UPDATE_PHOTO_INDEX_FOR_ALBUM_COUNT_COVER = 91, 122 VERSION_ADD_BURST_COVER_LEVEL_AND_BURST_KEY = 92, 123 VERSION_CREATE_BURSTKEY_INDEX = 93, 124 VERSION_PORTRAIT_COVER_SELECTION_ADD_COLUMNS = 94, 125 VERSION_UPDATE_DATA_ADDED_INDEX = 95, 126 VERSION_ADD_APP_URI_PERMISSION_INFO = 96, 127 VERSION_UPGRADE_THUMBNAIL = 97, 128 VERSION_UPDATE_SEARCH_INDEX_TRIGGER = 98, 129 VERSION_UPDATE_MULTI_CROP_INFO = 99, 130 VERSION_UDAPTE_DATA_UNIQUE = 100, 131 VERSION_UPDATE_BURST_DIRTY = 101, 132 VERSION_ADD_ORIGINAL_SUBTYPE = 102, 133 VERSION_CLOUD_ENAHCNEMENT = 103, 134 VERSION_UPDATE_MDIRTY_TRIGGER_FOR_UPLOADING_MOVING_PHOTO = 104, 135 VERSION_ADD_INDEX_FOR_FILEID = 105, 136 VERSION_MOVE_AUDIOS = 106, 137 VERSION_FIX_PHOTO_SCHPT_MEDIA_TYPE_INDEX = 107, 138 VERSION_ADD_OWNER_ALBUM_ID = 108, 139 VERSION_ADD_THUMBNAIL_VISIBLE = 130, 140 VERSION_ADD_DETAIL_TIME = 131, 141 VERSION_COMPAT_LIVE_PHOTO = 132, 142 VERSION_ADD_CLOUD_ENHANCEMENT_ALBUM = 133, 143 VERSION_ADD_THUMBNAIL_VISIBLE_FIX = 134, 144 VERSION_ADD_HIGHLIGHT_MAP_TABLES = 135, 145 VERSION_UPDATE_SEARCH_INDEX_TRIGGER_FOR_CLEAN_FLAG = 136, 146 VERSION_CREATE_TAB_OLD_PHOTOS = 137, 147 VERSION_HDR_AND_CLOUD_ENAHCNEMENT_FIX = 138, 148 VERSION_THUMBNAIL_READY_FIX = 139, 149 VERSION_UPDATE_AOI = 140, 150 VERSION_UPDATE_SOURCE_PHOTO_ALBUM_TRIGGER = 141, 151 VERSION_ADD_READY_COUNT_INDEX = 142, 152 VERSION_UPDATE_DATETAKEN_AND_DETAILTIME = 143, 153 VERSION_ADD_SUPPORTED_WATERMARK_TYPE = 144, 154 VERSION_FIX_DATE_ADDED_INDEX = 145, 155 VERSION_REVERT_FIX_DATE_ADDED_INDEX = 146, 156 VERSION_FIX_PICTURE_LCD_SIZE = 147, 157 VERSION_UPDATE_PHOTOS_DATE_AND_IDX = 148, 158 VERSION_ADD_CHECK_FLAG = 149, 159 VERSION_UPDATE_MEDIA_TYPE_AND_THUMBNAIL_READY_IDX = 150, 160 }; 161 162 enum { 163 MEDIA_API_VERSION_DEFAULT = 8, 164 MEDIA_API_VERSION_V9, 165 MEDIA_API_VERSION_V10, 166 }; 167 168 const std::vector<std::string> CAMERA_BUNDLE_NAMES = { 169 "com.huawei.hmos.camera" 170 }; 171 172 enum CloudFilePosition { 173 POSITION_LOCAL = 1 << 0, 174 POSITION_CLOUD = 1 << 1, 175 }; 176 177 const std::string MEDIA_LIBRARY_VERSION = "1.0"; 178 179 const int32_t DEVICE_SYNCSTATUSING = 0; 180 const int32_t DEVICE_SYNCSTATUS_COMPLETE = 1; 181 182 const std::string MEDIA_DATA_DEVICE_PATH = "local"; 183 const std::string MEDIALIBRARY_TABLE = "Files"; 184 const std::string SMARTALBUM_TABLE = "SmartAlbum"; 185 const std::string SMARTALBUM_MAP_TABLE = "SmartMap"; 186 const std::string CATEGORY_SMARTALBUM_MAP_TABLE = "CategorySmartAlbumMap"; 187 const std::string MEDIATYPE_DIRECTORY_TABLE = "MediaTypeDirectory"; 188 const std::string DEVICE_TABLE = "Device"; 189 const std::string BUNDLE_PERMISSION_TABLE = "BundlePermission"; 190 const std::string MEDIA_DATA_ABILITY_DB_NAME = "media_library.db"; 191 192 const std::string BUNDLE_NAME = "com.ohos.medialibrary.medialibrarydata"; 193 194 const std::string ML_FILE_SCHEME = "file"; 195 const std::string ML_FILE_PREFIX = "file://"; 196 const std::string ML_FILE_URI_PREFIX = "file://media"; 197 const std::string ML_URI_NETWORKID = "networkid"; 198 const std::string ML_URI_NETWORKID_EQUAL = "?networkid="; 199 const std::string ML_URI_TIME_ID = "&time_id="; 200 const std::string ML_URI_OFFSET = "&offset="; 201 const std::string ML_URI_DATE_ADDED = "date_added"; 202 const std::string ML_URI_DATE_TAKEN = "date_taken"; 203 const std::string ML_URI_AUTHORITY = "media"; 204 const std::string ML_DATA_SHARE_SCHEME = "datashare"; 205 const std::string MEDIALIBRARY_DATA_ABILITY_PREFIX = "datashare://"; 206 const std::string MEDIALIBRARY_DATA_URI_IDENTIFIER = "/media"; 207 const std::string MEDIALIBRARY_MEDIA_PREFIX = MEDIALIBRARY_DATA_ABILITY_PREFIX + 208 MEDIALIBRARY_DATA_URI_IDENTIFIER; 209 const std::string MEDIALIBRARY_TYPE_AUDIO_URI = "/audio"; 210 const std::string MEDIALIBRARY_TYPE_VIDEO_URI = "/video"; 211 const std::string MEDIALIBRARY_TYPE_IMAGE_URI = "/image"; 212 const std::string MEDIALIBRARY_TYPE_FILE_URI = "/file"; 213 const std::string MEDIALIBRARY_TYPE_ALBUM_URI = "/album"; 214 const std::string MEDIALIBRARY_TYPE_SMARTALBUM_CHANGE_URI = "/smartalbum"; 215 const std::string MEDIALIBRARY_TYPE_DEVICE_URI = "/device"; 216 const std::string MEDIALIBRARY_TYPE_SMART_URI = "/smart"; 217 const std::string MEDIALIBRARY_TYPE_HIGHLIGHT_URI = "/highlight"; 218 219 const std::string AUDIO_URI_PREFIX = ML_FILE_URI_PREFIX + MEDIALIBRARY_TYPE_AUDIO_URI; 220 const std::string VIDEO_URI_PREFIX = ML_FILE_URI_PREFIX + MEDIALIBRARY_TYPE_VIDEO_URI; 221 const std::string IMAGE_URI_PREFIX = ML_FILE_URI_PREFIX + MEDIALIBRARY_TYPE_IMAGE_URI; 222 const std::string FILE_URI_PREFIX = ML_FILE_URI_PREFIX + MEDIALIBRARY_TYPE_FILE_URI; 223 const std::string ALBUM_URI_PREFIX = ML_FILE_URI_PREFIX + MEDIALIBRARY_TYPE_ALBUM_URI; 224 const std::string HIGHLIGHT_URI_PREFIX = ML_FILE_URI_PREFIX + MEDIALIBRARY_TYPE_HIGHLIGHT_URI; 225 226 const std::string URI_TYPE_PHOTO = "Photo"; 227 const std::string URI_TYPE_AUDIO_V10 = "Audio"; 228 const std::string URI_TYPE_PHOTO_ALBUM = "PhotoAlbum"; 229 constexpr int64_t AGING_TIME = 30LL * 60 * 60 * 24 * 1000; 230 231 const std::string MEDIALIBRARY_SMARTALBUM_URI = MEDIALIBRARY_DATA_URI + "/" + SMARTALBUM_TABLE; 232 const std::string MEDIALIBRARY_SMARTALBUM_MAP_URI = MEDIALIBRARY_DATA_URI + "/" + SMARTALBUM_MAP_TABLE; 233 const std::string MEDIALIBRARY_CATEGORY_SMARTALBUM_MAP_URI = MEDIALIBRARY_DATA_URI + "/" 234 + CATEGORY_SMARTALBUM_MAP_TABLE; 235 const std::string MEDIALIBRARY_DIRECTORY_URI = MEDIALIBRARY_DATA_URI + "/" + MEDIATYPE_DIRECTORY_TABLE; 236 const std::string MEDIALIBRARY_BUNDLEPERM_URI = MEDIALIBRARY_DATA_URI + "/" + BUNDLE_PERMISSION_INSERT; 237 238 const std::string MEDIALIBRARY_CHECK_URIPERM_URI = MEDIALIBRARY_DATA_URI + "/" + CHECK_URI_PERMISSION; 239 const std::string MEDIALIBRARY_GRANT_URIPERM_URI = MEDIALIBRARY_DATA_URI + "/" + GRANT_URI_PERMISSION; 240 241 const std::string MEDIALIBRARY_AUDIO_URI = MEDIALIBRARY_DATA_URI + '/' + "audio"; 242 const std::string MEDIALIBRARY_VIDEO_URI = MEDIALIBRARY_DATA_URI + '/' + "video"; 243 const std::string MEDIALIBRARY_IMAGE_URI = MEDIALIBRARY_DATA_URI + '/' + "image"; 244 const std::string MEDIALIBRARY_FILE_URI = MEDIALIBRARY_DATA_URI + '/' + "file"; 245 const std::string MEDIALIBRARY_ALBUM_URI = MEDIALIBRARY_DATA_URI + '/' + "album"; 246 const std::string MEDIALIBRARY_SMARTALBUM_CHANGE_URI = MEDIALIBRARY_DATA_URI + '/' + "smartalbum"; 247 const std::string MEDIALIBRARY_DEVICE_URI = MEDIALIBRARY_DATA_URI + '/' + "device"; 248 const std::string MEDIALIBRARY_SMART_URI = MEDIALIBRARY_DATA_URI + '/' + "smart"; 249 const std::string MEDIALIBRARY_REMOTEFILE_URI = MEDIALIBRARY_DATA_URI + '/' + "remotfile"; 250 251 const std::string MEDIA_DATA_DB_ID = "file_id"; 252 const std::string MEDIA_DATA_DB_URI = "uri"; 253 const std::string MEDIA_DATA_DB_FILE_PATH = "data"; 254 const std::string MEDIA_DATA_DB_SIZE = "size"; 255 const std::string MEDIA_DATA_DB_PARENT_ID = "parent"; 256 const std::string MEDIA_DATA_DB_DATE_MODIFIED = "date_modified"; 257 const std::string MEDIA_DATA_DB_DATE_MODIFIED_S = "date_modified_s"; 258 const std::string MEDIA_DATA_DB_DATE_MODIFIED_MS = "date_modified_ms"; 259 const std::string MEDIA_DATA_DB_DATE_MODIFIED_TO_SECOND = "CAST(date_modified / 1000 AS BIGINT) AS date_modified_s"; 260 const std::string MEDIA_DATA_DB_DATE_ADDED = "date_added"; 261 const std::string MEDIA_DATA_DB_DATE_ADDED_S = "date_added_s"; 262 const std::string MEDIA_DATA_DB_DATE_ADDED_MS = "date_added_ms"; 263 const std::string MEDIA_DATA_DB_DATE_ADDED_TO_SECOND = "CAST(date_added / 1000 AS BIGINT) AS date_added_s"; 264 const std::string MEDIA_DATA_DB_MIME_TYPE = "mime_type"; 265 const std::string MEDIA_DATA_DB_TITLE = "title"; 266 const std::string MEDIA_DATA_DB_DESCRIPTION = "description"; 267 const std::string MEDIA_DATA_DB_NAME = "display_name"; 268 const std::string MEDIA_DATA_DB_ORIENTATION = "orientation"; 269 const std::string MEDIA_DATA_DB_LATITUDE = "latitude"; 270 const std::string MEDIA_DATA_DB_LONGITUDE = "longitude"; 271 const std::string MEDIA_DATA_DB_DATE_TAKEN = "date_taken"; 272 const std::string MEDIA_DATA_DB_DATE_TAKEN_S = "date_taken_s"; 273 const std::string MEDIA_DATA_DB_DATE_TAKEN_MS = "date_taken_ms"; 274 const std::string MEDIA_DATA_DB_DATE_TAKEN_TO_SECOND = "CAST(date_taken / 1000 AS BIGINT) AS date_taken_s"; 275 const std::string MEDIA_DATA_DB_THUMBNAIL = "thumbnail"; 276 const std::string MEDIA_DATA_DB_THUMB_ASTC = "astc"; 277 const std::string MEDIA_DATA_DB_HAS_ASTC = "has_astc"; // This attribute has been replaced by "thumbnail_ready" 278 const std::string MEDIA_DATA_DB_CONTENT_CREATE_TIME = "content_create_time"; 279 const std::string MEDIA_DATA_DB_POSITION = "position"; 280 const std::string MEDIA_DATA_DB_DIRTY = "dirty"; 281 const std::string MEDIA_DATA_DB_CLOUD_ID = "cloud_id"; 282 const std::string MEDIA_DATA_DB_META_DATE_MODIFIED = "meta_date_modified"; 283 const std::string MEDIA_DATA_DB_SYNC_STATUS = "sync_status"; 284 const std::string MEDIA_DATA_DB_THUMBNAIL_READY = "thumbnail_ready"; 285 286 const std::string MEDIA_DATA_DB_LCD = "lcd"; 287 const std::string MEDIA_DATA_DB_BUCKET_ID = "bucket_id"; 288 const std::string MEDIA_DATA_DB_BUCKET_NAME = "bucket_display_name"; 289 const std::string MEDIA_DATA_DB_DURATION = "duration"; 290 const std::string MEDIA_DATA_DB_ARTIST = "artist"; 291 292 const std::string MEDIA_DATA_DB_AUDIO_ALBUM = "audio_album"; 293 const std::string MEDIA_DATA_DB_MEDIA_TYPE = "media_type"; 294 295 const std::string MEDIA_DATA_DB_HEIGHT = "height"; 296 const std::string MEDIA_DATA_DB_WIDTH = "width"; 297 const std::string MEDIA_DATA_DB_OWNER_PACKAGE = "owner_package"; 298 const std::string MEDIA_DATA_DB_OWNER_APPID = "owner_appid"; 299 const std::string MEDIA_DATA_DB_PACKAGE_NAME = "package_name"; 300 301 const std::string MEDIA_DATA_DB_IS_FAV = "is_favorite"; 302 const std::string MEDIA_DATA_DB_IS_TRASH = "is_trash"; 303 const std::string MEDIA_DATA_DB_RECYCLE_PATH = "recycle_path"; 304 const std::string MEDIA_DATA_DB_DATE_TRASHED = "date_trashed"; 305 const std::string MEDIA_DATA_DB_DATE_TRASHED_S = "date_trashed_s"; 306 const std::string MEDIA_DATA_DB_DATE_TRASHED_MS = "date_trashed_ms"; 307 const std::string MEDIA_DATA_DB_DATE_TRASHED_TO_SECOND = "CAST(date_trashed / 1000 AS BIGINT) AS date_trashed_s"; 308 const std::string MEDIA_DATA_DB_IS_PENDING = "is_pending"; 309 const std::string MEDIA_DATA_DB_TIME_PENDING = "time_pending"; 310 const std::string MEDIA_DATA_DB_RELATIVE_PATH = "relative_path"; 311 const std::string MEDIA_DATA_DB_VOLUME_NAME = "volume_name"; 312 const std::string MEDIA_DATA_DB_SELF_ID = "self_id"; 313 const std::string MEDIA_DATA_DB_DEVICE_NAME = "device_name"; 314 315 const std::string MEDIA_DATA_DB_ALBUM = "album"; 316 const std::string MEDIA_DATA_DB_ALBUM_ID = "album_id"; 317 const std::string MEDIA_DATA_DB_REFERENCE_ALBUM_ID = "reference_album_id"; 318 const std::string MEDIA_DATA_DB_ALBUM_NAME = "album_name"; 319 const std::string MEDIA_DATA_DB_COUNT = "count"; 320 const std::string MEDIA_DATA_BUNDLENAME = "bundle_name"; 321 const std::string MEDIA_DATA_DB_IS_LOCAL = "is_local"; 322 const std::string MEDIA_DATA_DB_HIGHLIGHT = "highlight"; 323 324 const std::string MEDIA_DATA_CALLING_UID = "calling_uid"; 325 326 const std::map<std::string, std::string> DATE_TRANSITION_MAP = { 327 { MEDIA_DATA_DB_DATE_MODIFIED_MS, MEDIA_DATA_DB_DATE_MODIFIED }, 328 { MEDIA_DATA_DB_DATE_ADDED_MS, MEDIA_DATA_DB_DATE_ADDED }, 329 { MEDIA_DATA_DB_DATE_TRASHED_MS, MEDIA_DATA_DB_DATE_TRASHED }, 330 { MEDIA_DATA_DB_DATE_TAKEN_MS, MEDIA_DATA_DB_DATE_TAKEN }, 331 }; 332 333 // ringtone uri constants 334 const std::string MEDIA_DATA_DB_RINGTONE_URI = "ringtone_uri"; 335 const std::string MEDIA_DATA_DB_ALARM_URI = "alarm_uri"; 336 const std::string MEDIA_DATA_DB_NOTIFICATION_URI = "notification_uri"; 337 const std::string MEDIA_DATA_DB_RINGTONE_TYPE = "ringtone_type"; 338 339 const std::string MEDIA_DATA_DB_PHOTO_ID = "photo_id"; 340 const std::string MEDIA_DATA_DB_PHOTO_QUALITY = "photo_quality"; 341 const std::string MEDIA_DATA_DB_FIRST_VISIT_TIME = "first_visit_time"; 342 const std::string MEDIA_DATA_DB_DEFERRED_PROC_TYPE = "deferred_proc_type"; 343 344 const std::string MEDIA_COLUMN_COUNT = "count(*)"; 345 const std::string MEDIA_COLUMN_COUNT_1 = "count(1)"; 346 const std::string MEDIA_COLUMN_COUNT_DISTINCT_FILE_ID = "count(distinct file_id)"; 347 348 const std::string PHOTO_INDEX = "photo_index"; 349 350 const std::string PERMISSION_ID = "id"; 351 const std::string PERMISSION_BUNDLE_NAME = "bundle_name"; 352 const std::string PERMISSION_FILE_ID = "file_id"; 353 const std::string PERMISSION_MODE = "mode"; 354 const std::string PERMISSION_TABLE_TYPE = "table_type"; 355 356 const std::string FILE_TABLE = "file"; 357 const std::string ALBUM_TABLE = "album"; 358 const std::string ALBUM_VIEW_NAME = "Album"; 359 360 const std::string SMARTALBUMMAP_TABLE_NAME = "smartAlbumMap"; 361 const std::string SMARTALBUMASSETS_VIEW_NAME = "SmartAsset"; 362 const std::string SMARTALBUMASSETS_ALBUMCAPACITY = "size"; 363 const std::string SMARTABLUMASSETS_PARENTID = "parentid"; 364 365 const std::string ASSETMAP_VIEW_NAME = "AssetMap"; 366 367 const std::string IMAGE_ASSET_TYPE = "image"; 368 const std::string VIDEO_ASSET_TYPE = "video"; 369 const std::string AUDIO_ASSET_TYPE = "audio"; 370 371 // Caution: Keep same definition as MediaColumn! Only for where clause check in API9 getAlbums and album.getFileAssets 372 const std::string COMPAT_ALBUM_SUBTYPE = "album_subtype"; 373 const std::string COMPAT_HIDDEN = "hidden"; 374 const std::string COMPAT_PHOTO_SYNC_STATUS = "sync_status"; 375 const std::string COMPAT_FILE_SUBTYPE = "subtype"; 376 const std::string COMPAT_CAMERA_SHOT_KEY = "camera_shot_key"; 377 378 // system relativePath and albumName, use for API9 compatible API10 379 const std::string CAMERA_PATH = "Camera/"; 380 const std::string SCREEN_SHOT_PATH = "Pictures/Screenshots/"; 381 const std::string SCREEN_RECORD_PATH = "Videos/ScreenRecordings/"; 382 383 const std::string CAMERA_ALBUM_NAME = "Camera"; 384 const std::string SCREEN_SHOT_ALBUM_NAME = "Screenshots"; 385 const std::string SCREEN_RECORD_ALBUM_NAME = "ScreenRecordings"; 386 387 // extension 388 const std::string ASSET_EXTENTION = "extention"; 389 390 // delete_tool 391 const std::string DELETE_TOOL_ONLY_DATABASE = "only_db"; 392 393 // edit param 394 const std::string EDIT_DATA_REQUEST = "edit_data_request"; // MEDIA_OPERN_KEYWORD=EDIT_DATA_REQUEST 395 const std::string SOURCE_REQUEST = "source_request"; // MEDIA_OPERN_KEYWORD=SOURCE_REQUEST 396 const std::string COMMIT_REQUEST = "commit_request"; // MEDIA_OPERN_KEYWORD=COMMIT_REQUEST 397 const std::string EDIT_DATA = "edit_data"; 398 const std::string COMPATIBLE_FORMAT = "compatible_format"; 399 const std::string FORMAT_VERSION = "format_version"; 400 const std::string APP_ID = "app_id"; 401 402 // write cache 403 const std::string CACHE_FILE_NAME = "cache_file_name"; 404 const std::string CACHE_MOVING_PHOTO_VIDEO_NAME = "cache_moving_photo_video_name"; 405 406 // moving photo param 407 const std::string OPEN_MOVING_PHOTO_VIDEO = "open_video"; // MEDIA_MOVING_PHOTO_OPRN_KEYWORD=OPEN_MOVING_PHOTO_VIDEO 408 const std::string OPEN_PRIVATE_LIVE_PHOTO = "open_private_live_photo"; 409 410 // db sandbox directory 411 const std::string MEDIA_DB_DIR = "/data/medialibrary/database"; 412 413 // slave medialibrary db file path 414 const std::string MEDIA_DB_FILE_SLAVE = "/data/storage/el2/database/rdb/media_library_slave.db"; 415 const std::string MEDIA_DB_FILE_SLAVE_SHM = "/data/storage/el2/database/rdb/media_library_slave.db-shm"; 416 const std::string MEDIA_DB_FILE_SLAVE_WAL = "/data/storage/el2/database/rdb/media_library_slave.db-wal"; 417 418 // requestId for generating thumbnail in batches 419 const std::string THUMBNAIL_BATCH_GENERATE_REQUEST_ID = "thumbnail_request_id"; 420 const std::string IMAGE_FILE_TYPE = "image_file_type"; 421 422 } // namespace Media 423 } // namespace OHOS 424 425 #endif // INTERFACES_INNERKITS_NATIVE_INCLUDE_MEDIA_DATA_ABILITY_CONST_H_ 426