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 = 148; 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 }; 159 160 enum { 161 MEDIA_API_VERSION_DEFAULT = 8, 162 MEDIA_API_VERSION_V9, 163 MEDIA_API_VERSION_V10, 164 }; 165 166 const std::vector<std::string> CAMERA_BUNDLE_NAMES = { 167 "com.huawei.hmos.camera" 168 }; 169 170 enum CloudFilePosition { 171 POSITION_LOCAL = 1 << 0, 172 POSITION_CLOUD = 1 << 1, 173 }; 174 175 const std::string MEDIA_LIBRARY_VERSION = "1.0"; 176 177 const int32_t DEVICE_SYNCSTATUSING = 0; 178 const int32_t DEVICE_SYNCSTATUS_COMPLETE = 1; 179 180 const std::string MEDIA_DATA_DEVICE_PATH = "local"; 181 const std::string MEDIALIBRARY_TABLE = "Files"; 182 const std::string SMARTALBUM_TABLE = "SmartAlbum"; 183 const std::string SMARTALBUM_MAP_TABLE = "SmartMap"; 184 const std::string CATEGORY_SMARTALBUM_MAP_TABLE = "CategorySmartAlbumMap"; 185 const std::string MEDIATYPE_DIRECTORY_TABLE = "MediaTypeDirectory"; 186 const std::string DEVICE_TABLE = "Device"; 187 const std::string BUNDLE_PERMISSION_TABLE = "BundlePermission"; 188 const std::string MEDIA_DATA_ABILITY_DB_NAME = "media_library.db"; 189 190 const std::string BUNDLE_NAME = "com.ohos.medialibrary.medialibrarydata"; 191 192 const std::string ML_FILE_SCHEME = "file"; 193 const std::string ML_FILE_PREFIX = "file://"; 194 const std::string ML_FILE_URI_PREFIX = "file://media"; 195 const std::string ML_URI_NETWORKID = "networkid"; 196 const std::string ML_URI_NETWORKID_EQUAL = "?networkid="; 197 const std::string ML_URI_TIME_ID = "&time_id="; 198 const std::string ML_URI_OFFSET = "&offset="; 199 const std::string ML_URI_DATE_ADDED = "date_added"; 200 const std::string ML_URI_DATE_TAKEN = "date_taken"; 201 const std::string ML_URI_AUTHORITY = "media"; 202 const std::string ML_DATA_SHARE_SCHEME = "datashare"; 203 const std::string MEDIALIBRARY_DATA_ABILITY_PREFIX = "datashare://"; 204 const std::string MEDIALIBRARY_DATA_URI_IDENTIFIER = "/media"; 205 const std::string MEDIALIBRARY_MEDIA_PREFIX = MEDIALIBRARY_DATA_ABILITY_PREFIX + 206 MEDIALIBRARY_DATA_URI_IDENTIFIER; 207 const std::string MEDIALIBRARY_TYPE_AUDIO_URI = "/audio"; 208 const std::string MEDIALIBRARY_TYPE_VIDEO_URI = "/video"; 209 const std::string MEDIALIBRARY_TYPE_IMAGE_URI = "/image"; 210 const std::string MEDIALIBRARY_TYPE_FILE_URI = "/file"; 211 const std::string MEDIALIBRARY_TYPE_ALBUM_URI = "/album"; 212 const std::string MEDIALIBRARY_TYPE_SMARTALBUM_CHANGE_URI = "/smartalbum"; 213 const std::string MEDIALIBRARY_TYPE_DEVICE_URI = "/device"; 214 const std::string MEDIALIBRARY_TYPE_SMART_URI = "/smart"; 215 const std::string MEDIALIBRARY_TYPE_HIGHLIGHT_URI = "/highlight"; 216 217 const std::string AUDIO_URI_PREFIX = ML_FILE_URI_PREFIX + MEDIALIBRARY_TYPE_AUDIO_URI; 218 const std::string VIDEO_URI_PREFIX = ML_FILE_URI_PREFIX + MEDIALIBRARY_TYPE_VIDEO_URI; 219 const std::string IMAGE_URI_PREFIX = ML_FILE_URI_PREFIX + MEDIALIBRARY_TYPE_IMAGE_URI; 220 const std::string FILE_URI_PREFIX = ML_FILE_URI_PREFIX + MEDIALIBRARY_TYPE_FILE_URI; 221 const std::string ALBUM_URI_PREFIX = ML_FILE_URI_PREFIX + MEDIALIBRARY_TYPE_ALBUM_URI; 222 const std::string HIGHLIGHT_URI_PREFIX = ML_FILE_URI_PREFIX + MEDIALIBRARY_TYPE_HIGHLIGHT_URI; 223 224 const std::string URI_TYPE_PHOTO = "Photo"; 225 const std::string URI_TYPE_AUDIO_V10 = "Audio"; 226 const std::string URI_TYPE_PHOTO_ALBUM = "PhotoAlbum"; 227 constexpr int64_t AGING_TIME = 30LL * 60 * 60 * 24 * 1000; 228 229 const std::string MEDIALIBRARY_SMARTALBUM_URI = MEDIALIBRARY_DATA_URI + "/" + SMARTALBUM_TABLE; 230 const std::string MEDIALIBRARY_SMARTALBUM_MAP_URI = MEDIALIBRARY_DATA_URI + "/" + SMARTALBUM_MAP_TABLE; 231 const std::string MEDIALIBRARY_CATEGORY_SMARTALBUM_MAP_URI = MEDIALIBRARY_DATA_URI + "/" 232 + CATEGORY_SMARTALBUM_MAP_TABLE; 233 const std::string MEDIALIBRARY_DIRECTORY_URI = MEDIALIBRARY_DATA_URI + "/" + MEDIATYPE_DIRECTORY_TABLE; 234 const std::string MEDIALIBRARY_BUNDLEPERM_URI = MEDIALIBRARY_DATA_URI + "/" + BUNDLE_PERMISSION_INSERT; 235 236 const std::string MEDIALIBRARY_CHECK_URIPERM_URI = MEDIALIBRARY_DATA_URI + "/" + CHECK_URI_PERMISSION; 237 const std::string MEDIALIBRARY_GRANT_URIPERM_URI = MEDIALIBRARY_DATA_URI + "/" + GRANT_URI_PERMISSION; 238 239 const std::string MEDIALIBRARY_AUDIO_URI = MEDIALIBRARY_DATA_URI + '/' + "audio"; 240 const std::string MEDIALIBRARY_VIDEO_URI = MEDIALIBRARY_DATA_URI + '/' + "video"; 241 const std::string MEDIALIBRARY_IMAGE_URI = MEDIALIBRARY_DATA_URI + '/' + "image"; 242 const std::string MEDIALIBRARY_FILE_URI = MEDIALIBRARY_DATA_URI + '/' + "file"; 243 const std::string MEDIALIBRARY_ALBUM_URI = MEDIALIBRARY_DATA_URI + '/' + "album"; 244 const std::string MEDIALIBRARY_SMARTALBUM_CHANGE_URI = MEDIALIBRARY_DATA_URI + '/' + "smartalbum"; 245 const std::string MEDIALIBRARY_DEVICE_URI = MEDIALIBRARY_DATA_URI + '/' + "device"; 246 const std::string MEDIALIBRARY_SMART_URI = MEDIALIBRARY_DATA_URI + '/' + "smart"; 247 const std::string MEDIALIBRARY_REMOTEFILE_URI = MEDIALIBRARY_DATA_URI + '/' + "remotfile"; 248 249 const std::string MEDIA_DATA_DB_ID = "file_id"; 250 const std::string MEDIA_DATA_DB_URI = "uri"; 251 const std::string MEDIA_DATA_DB_FILE_PATH = "data"; 252 const std::string MEDIA_DATA_DB_SIZE = "size"; 253 const std::string MEDIA_DATA_DB_PARENT_ID = "parent"; 254 const std::string MEDIA_DATA_DB_DATE_MODIFIED = "date_modified"; 255 const std::string MEDIA_DATA_DB_DATE_MODIFIED_S = "date_modified_s"; 256 const std::string MEDIA_DATA_DB_DATE_MODIFIED_MS = "date_modified_ms"; 257 const std::string MEDIA_DATA_DB_DATE_MODIFIED_TO_SECOND = "CAST(date_modified / 1000 AS BIGINT) AS date_modified_s"; 258 const std::string MEDIA_DATA_DB_DATE_ADDED = "date_added"; 259 const std::string MEDIA_DATA_DB_DATE_ADDED_S = "date_added_s"; 260 const std::string MEDIA_DATA_DB_DATE_ADDED_MS = "date_added_ms"; 261 const std::string MEDIA_DATA_DB_DATE_ADDED_TO_SECOND = "CAST(date_added / 1000 AS BIGINT) AS date_added_s"; 262 const std::string MEDIA_DATA_DB_MIME_TYPE = "mime_type"; 263 const std::string MEDIA_DATA_DB_TITLE = "title"; 264 const std::string MEDIA_DATA_DB_DESCRIPTION = "description"; 265 const std::string MEDIA_DATA_DB_NAME = "display_name"; 266 const std::string MEDIA_DATA_DB_ORIENTATION = "orientation"; 267 const std::string MEDIA_DATA_DB_LATITUDE = "latitude"; 268 const std::string MEDIA_DATA_DB_LONGITUDE = "longitude"; 269 const std::string MEDIA_DATA_DB_DATE_TAKEN = "date_taken"; 270 const std::string MEDIA_DATA_DB_DATE_TAKEN_S = "date_taken_s"; 271 const std::string MEDIA_DATA_DB_DATE_TAKEN_MS = "date_taken_ms"; 272 const std::string MEDIA_DATA_DB_DATE_TAKEN_TO_SECOND = "CAST(date_taken / 1000 AS BIGINT) AS date_taken_s"; 273 const std::string MEDIA_DATA_DB_THUMBNAIL = "thumbnail"; 274 const std::string MEDIA_DATA_DB_THUMB_ASTC = "astc"; 275 const std::string MEDIA_DATA_DB_HAS_ASTC = "has_astc"; // This attribute has been replaced by "thumbnail_ready" 276 const std::string MEDIA_DATA_DB_CONTENT_CREATE_TIME = "content_create_time"; 277 const std::string MEDIA_DATA_DB_POSITION = "position"; 278 const std::string MEDIA_DATA_DB_DIRTY = "dirty"; 279 const std::string MEDIA_DATA_DB_CLOUD_ID = "cloud_id"; 280 const std::string MEDIA_DATA_DB_META_DATE_MODIFIED = "meta_date_modified"; 281 const std::string MEDIA_DATA_DB_SYNC_STATUS = "sync_status"; 282 const std::string MEDIA_DATA_DB_THUMBNAIL_READY = "thumbnail_ready"; 283 284 const std::string MEDIA_DATA_DB_LCD = "lcd"; 285 const std::string MEDIA_DATA_DB_BUCKET_ID = "bucket_id"; 286 const std::string MEDIA_DATA_DB_BUCKET_NAME = "bucket_display_name"; 287 const std::string MEDIA_DATA_DB_DURATION = "duration"; 288 const std::string MEDIA_DATA_DB_ARTIST = "artist"; 289 290 const std::string MEDIA_DATA_DB_AUDIO_ALBUM = "audio_album"; 291 const std::string MEDIA_DATA_DB_MEDIA_TYPE = "media_type"; 292 293 const std::string MEDIA_DATA_DB_HEIGHT = "height"; 294 const std::string MEDIA_DATA_DB_WIDTH = "width"; 295 const std::string MEDIA_DATA_DB_OWNER_PACKAGE = "owner_package"; 296 const std::string MEDIA_DATA_DB_OWNER_APPID = "owner_appid"; 297 const std::string MEDIA_DATA_DB_PACKAGE_NAME = "package_name"; 298 299 const std::string MEDIA_DATA_DB_IS_FAV = "is_favorite"; 300 const std::string MEDIA_DATA_DB_IS_TRASH = "is_trash"; 301 const std::string MEDIA_DATA_DB_RECYCLE_PATH = "recycle_path"; 302 const std::string MEDIA_DATA_DB_DATE_TRASHED = "date_trashed"; 303 const std::string MEDIA_DATA_DB_DATE_TRASHED_S = "date_trashed_s"; 304 const std::string MEDIA_DATA_DB_DATE_TRASHED_MS = "date_trashed_ms"; 305 const std::string MEDIA_DATA_DB_DATE_TRASHED_TO_SECOND = "CAST(date_trashed / 1000 AS BIGINT) AS date_trashed_s"; 306 const std::string MEDIA_DATA_DB_IS_PENDING = "is_pending"; 307 const std::string MEDIA_DATA_DB_TIME_PENDING = "time_pending"; 308 const std::string MEDIA_DATA_DB_RELATIVE_PATH = "relative_path"; 309 const std::string MEDIA_DATA_DB_VOLUME_NAME = "volume_name"; 310 const std::string MEDIA_DATA_DB_SELF_ID = "self_id"; 311 const std::string MEDIA_DATA_DB_DEVICE_NAME = "device_name"; 312 313 const std::string MEDIA_DATA_DB_ALBUM = "album"; 314 const std::string MEDIA_DATA_DB_ALBUM_ID = "album_id"; 315 const std::string MEDIA_DATA_DB_REFERENCE_ALBUM_ID = "reference_album_id"; 316 const std::string MEDIA_DATA_DB_ALBUM_NAME = "album_name"; 317 const std::string MEDIA_DATA_DB_COUNT = "count"; 318 const std::string MEDIA_DATA_BUNDLENAME = "bundle_name"; 319 const std::string MEDIA_DATA_DB_IS_LOCAL = "is_local"; 320 const std::string MEDIA_DATA_DB_HIGHLIGHT = "highlight"; 321 322 const std::string MEDIA_DATA_CALLING_UID = "calling_uid"; 323 324 const std::map<std::string, std::string> DATE_TRANSITION_MAP = { 325 { MEDIA_DATA_DB_DATE_MODIFIED_MS, MEDIA_DATA_DB_DATE_MODIFIED }, 326 { MEDIA_DATA_DB_DATE_ADDED_MS, MEDIA_DATA_DB_DATE_ADDED }, 327 { MEDIA_DATA_DB_DATE_TRASHED_MS, MEDIA_DATA_DB_DATE_TRASHED }, 328 { MEDIA_DATA_DB_DATE_TAKEN_MS, MEDIA_DATA_DB_DATE_TAKEN }, 329 }; 330 331 // ringtone uri constants 332 const std::string MEDIA_DATA_DB_RINGTONE_URI = "ringtone_uri"; 333 const std::string MEDIA_DATA_DB_ALARM_URI = "alarm_uri"; 334 const std::string MEDIA_DATA_DB_NOTIFICATION_URI = "notification_uri"; 335 const std::string MEDIA_DATA_DB_RINGTONE_TYPE = "ringtone_type"; 336 337 const std::string MEDIA_DATA_DB_PHOTO_ID = "photo_id"; 338 const std::string MEDIA_DATA_DB_PHOTO_QUALITY = "photo_quality"; 339 const std::string MEDIA_DATA_DB_FIRST_VISIT_TIME = "first_visit_time"; 340 const std::string MEDIA_DATA_DB_DEFERRED_PROC_TYPE = "deferred_proc_type"; 341 342 const std::string MEDIA_COLUMN_COUNT = "count(*)"; 343 const std::string MEDIA_COLUMN_COUNT_1 = "count(1)"; 344 const std::string MEDIA_COLUMN_COUNT_DISTINCT_FILE_ID = "count(distinct file_id)"; 345 346 const std::string PHOTO_INDEX = "photo_index"; 347 348 const std::string PERMISSION_ID = "id"; 349 const std::string PERMISSION_BUNDLE_NAME = "bundle_name"; 350 const std::string PERMISSION_FILE_ID = "file_id"; 351 const std::string PERMISSION_MODE = "mode"; 352 const std::string PERMISSION_TABLE_TYPE = "table_type"; 353 354 const std::string FILE_TABLE = "file"; 355 const std::string ALBUM_TABLE = "album"; 356 const std::string ALBUM_VIEW_NAME = "Album"; 357 358 const std::string SMARTALBUMMAP_TABLE_NAME = "smartAlbumMap"; 359 const std::string SMARTALBUMASSETS_VIEW_NAME = "SmartAsset"; 360 const std::string SMARTALBUMASSETS_ALBUMCAPACITY = "size"; 361 const std::string SMARTABLUMASSETS_PARENTID = "parentid"; 362 363 const std::string ASSETMAP_VIEW_NAME = "AssetMap"; 364 365 const std::string IMAGE_ASSET_TYPE = "image"; 366 const std::string VIDEO_ASSET_TYPE = "video"; 367 const std::string AUDIO_ASSET_TYPE = "audio"; 368 369 // Caution: Keep same definition as MediaColumn! Only for where clause check in API9 getAlbums and album.getFileAssets 370 const std::string COMPAT_ALBUM_SUBTYPE = "album_subtype"; 371 const std::string COMPAT_HIDDEN = "hidden"; 372 const std::string COMPAT_PHOTO_SYNC_STATUS = "sync_status"; 373 const std::string COMPAT_FILE_SUBTYPE = "subtype"; 374 const std::string COMPAT_CAMERA_SHOT_KEY = "camera_shot_key"; 375 376 // system relativePath and albumName, use for API9 compatible API10 377 const std::string CAMERA_PATH = "Camera/"; 378 const std::string SCREEN_SHOT_PATH = "Pictures/Screenshots/"; 379 const std::string SCREEN_RECORD_PATH = "Videos/ScreenRecordings/"; 380 381 const std::string CAMERA_ALBUM_NAME = "Camera"; 382 const std::string SCREEN_SHOT_ALBUM_NAME = "Screenshots"; 383 const std::string SCREEN_RECORD_ALBUM_NAME = "ScreenRecordings"; 384 385 // extension 386 const std::string ASSET_EXTENTION = "extention"; 387 388 // delete_tool 389 const std::string DELETE_TOOL_ONLY_DATABASE = "only_db"; 390 391 // edit param 392 const std::string EDIT_DATA_REQUEST = "edit_data_request"; // MEDIA_OPERN_KEYWORD=EDIT_DATA_REQUEST 393 const std::string SOURCE_REQUEST = "source_request"; // MEDIA_OPERN_KEYWORD=SOURCE_REQUEST 394 const std::string COMMIT_REQUEST = "commit_request"; // MEDIA_OPERN_KEYWORD=COMMIT_REQUEST 395 const std::string EDIT_DATA = "edit_data"; 396 const std::string COMPATIBLE_FORMAT = "compatible_format"; 397 const std::string FORMAT_VERSION = "format_version"; 398 const std::string APP_ID = "app_id"; 399 400 // write cache 401 const std::string CACHE_FILE_NAME = "cache_file_name"; 402 const std::string CACHE_MOVING_PHOTO_VIDEO_NAME = "cache_moving_photo_video_name"; 403 404 // moving photo param 405 const std::string OPEN_MOVING_PHOTO_VIDEO = "open_video"; // MEDIA_MOVING_PHOTO_OPRN_KEYWORD=OPEN_MOVING_PHOTO_VIDEO 406 const std::string OPEN_PRIVATE_LIVE_PHOTO = "open_private_live_photo"; 407 408 // db sandbox directory 409 const std::string MEDIA_DB_DIR = "/data/medialibrary/database"; 410 411 // slave medialibrary db file path 412 const std::string MEDIA_DB_FILE_SLAVE = "/data/storage/el2/database/rdb/media_library_slave.db"; 413 const std::string MEDIA_DB_FILE_SLAVE_SHM = "/data/storage/el2/database/rdb/media_library_slave.db-shm"; 414 const std::string MEDIA_DB_FILE_SLAVE_WAL = "/data/storage/el2/database/rdb/media_library_slave.db-wal"; 415 416 // requestId for generating thumbnail in batches 417 const std::string THUMBNAIL_BATCH_GENERATE_REQUEST_ID = "thumbnail_request_id"; 418 const std::string IMAGE_FILE_TYPE = "image_file_type"; 419 420 } // namespace Media 421 } // namespace OHOS 422 423 #endif // INTERFACES_INNERKITS_NATIVE_INCLUDE_MEDIA_DATA_ABILITY_CONST_H_ 424