1 /* 2 * Copyright (C) 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 RINGTONE_DB_CONST_H 17 #define RINGTONE_DB_CONST_H 18 19 #include <string> 20 21 namespace OHOS { 22 namespace Media { 23 24 const std::string RINGTONE_BUNDLE_NAME = "com.ohos.ringtonelibrary.ringtonelibrarydata"; 25 26 const std::string RINGTONE_URI_SCHEME = "datashare"; 27 const std::string RINGTONE_URI_AUTHORITY = "ringtone"; 28 const std::string RINGTONE_URI_PATH = "ringtone"; 29 const std::string RINGTONE_URI = RINGTONE_URI_SCHEME + ":///" + RINGTONE_URI_AUTHORITY; 30 const std::string RINGTONE_PATH_URI = RINGTONE_URI + "/" + RINGTONE_URI_PATH; 31 32 const std::string VIBRATE_URI_PATH = "vibrate"; 33 const std::string VIBRATE_PATH_URI = RINGTONE_URI + "/" + VIBRATE_URI_PATH; 34 35 const std::string RINGTONE_URI_PROXY_STRING = "?Proxy"; 36 37 // ringtone user customized tones file location 38 const std::string RINGTONE_CUSTOMIZED_BASE_PATH = "/data/storage/el2/base/files"; 39 const std::string RINGTONE_CUSTOMIZED_ALARM_PATH = RINGTONE_CUSTOMIZED_BASE_PATH + "/Ringtone/alarms"; 40 const std::string RINGTONE_CUSTOMIZED_RINGTONE_PATH = RINGTONE_CUSTOMIZED_BASE_PATH + "/Ringtone/ringtones"; 41 const std::string RINGTONE_CUSTOMIZED_NOTIFICATIONS_PATH = RINGTONE_CUSTOMIZED_BASE_PATH + "/Ringtone/notifications"; 42 const std::string RINGTONE_CUSTOMIZED_CONTACTS_PATH = RINGTONE_CUSTOMIZED_BASE_PATH + "/Ringtone/contacts"; 43 44 const std::string RINGTONE_CUSTOMIZED_BASE_RINGTONE_PATH = "/data/storage/el2/base/files/Ringtone"; 45 const std::string RINGTONE_CUSTOMIZED_BASE_RINGTONETMP_PATH = "/data/storage/el2/base/files/RingtoneTmp"; 46 47 // ringtone preload pathes 48 const std::string ROOT_TONE_PRELOAD_PATH_NOAH_PATH = "/sys_prod/resource/media/audio"; 49 const std::string ROOT_TONE_PRELOAD_PATH_CHINA_PATH = "/sys_prod/variant/region_comm/china/resource/media/audio"; 50 const std::string ROOT_TONE_PRELOAD_PATH_OVERSEA_PATH = "/sys_prod/variant/region_comm/oversea/resource/media/audio"; 51 52 // vibrate preload pathes 53 const std::string ROOT_VIBRATE_PRELOAD_PATH_NOAH_PATH = "/sys_prod/resource/media/haptics"; 54 const std::string ROOT_VIBRATE_PRELOAD_PATH_CHINA_PATH = "/sys_prod/variant/region_comm/china/resource/media/haptics"; 55 const std::string ROOT_VIBRATE_PRELOAD_PATH_OVERSEA_PATH = 56 "/sys_prod/variant/region_comm/oversea/resource/media/haptics"; 57 58 // ringtone DB file path 59 const std::string RINGTONE_LIBRARY_DB_PATH = "/data/storage/el2/database"; 60 const std::string RINGTONE_LIBRARY_DB_PATH_EL1 = "/data/storage/el1/database"; 61 62 // ringtone DB file name 63 const std::string RINGTONE_LIBRARY_DB_NAME = "ringtone_library.db"; 64 65 // ringtone db version 66 const int32_t RINGTONE_RDB_VERSION = 7; 67 enum { 68 VERSION_ADD_DISPLAY_LANGUAGE_COLUMN = 2, 69 VERSION_UPDATE_MIME_TYPE, 70 VERSION_ADD_PRELOAD_CONF_TABLE, 71 VERSION_ADD_VIBRATE_TABLE, 72 VERSION_UPDATE_WATCH_MIME_TYPE, 73 VERSION_ADD_SCANNER_FLAG, 74 }; 75 76 // ringtone table name 77 const std::string RINGTONE_TABLE = "ToneFiles"; 78 // ringtone table column name 79 const std::string RINGTONE_COLUMN_TONE_ID = "tone_id"; 80 const std::string RINGTONE_COLUMN_DATA = "data"; 81 const std::string RINGTONE_COLUMN_SIZE = "size"; 82 const std::string RINGTONE_COLUMN_DISPLAY_NAME = "display_name"; 83 const std::string RINGTONE_COLUMN_TITLE = "title"; 84 const std::string RINGTONE_COLUMN_MEDIA_TYPE = "media_type"; 85 const std::string RINGTONE_COLUMN_TONE_TYPE = "tone_type"; 86 const std::string RINGTONE_COLUMN_MIME_TYPE = "mime_type"; 87 const std::string RINGTONE_COLUMN_SOURCE_TYPE = "source_type"; 88 const std::string RINGTONE_COLUMN_DATE_ADDED = "date_added"; 89 const std::string RINGTONE_COLUMN_DATE_MODIFIED = "date_modified"; 90 const std::string RINGTONE_COLUMN_DATE_TAKEN = "date_taken"; 91 const std::string RINGTONE_COLUMN_DURATION = "duration"; 92 const std::string RINGTONE_COLUMN_SHOT_TONE_TYPE = "shot_tone_type"; 93 const std::string RINGTONE_COLUMN_SHOT_TONE_SOURCE_TYPE = "shot_tone_source_type"; 94 const std::string RINGTONE_COLUMN_NOTIFICATION_TONE_TYPE = "notification_tone_type"; 95 const std::string RINGTONE_COLUMN_NOTIFICATION_TONE_SOURCE_TYPE = "notification_tone_source_type"; 96 const std::string RINGTONE_COLUMN_RING_TONE_TYPE = "ring_tone_type"; 97 const std::string RINGTONE_COLUMN_RING_TONE_SOURCE_TYPE = "ring_tone_source_type"; 98 const std::string RINGTONE_COLUMN_ALARM_TONE_TYPE = "alarm_tone_type"; 99 const std::string RINGTONE_COLUMN_ALARM_TONE_SOURCE_TYPE = "alarm_tone_source_type"; 100 const std::string RINGTONE_COLUMN_DISPLAY_LANGUAGE_TYPE = "display_language_type"; 101 const std::string RINGTONE_COLUMN_SCANNER_FLAG = "scanner_flag"; 102 103 // preload config table name 104 const std::string PRELOAD_CONFIG_TABLE = "PreloadConfig"; 105 106 // preload config column name 107 const std::string PRELOAD_CONFIG_COLUMN_RING_TONE_TYPE = "ring_tone_type"; 108 const std::string PRELOAD_CONFIG_COLUMN_TONE_ID = "tone_id"; 109 const std::string PRELOAD_CONFIG_COLUMN_DISPLAY_NAME = "display_name"; 110 // simcard setting table name 111 const std::string SIMCARD_SETTING_TABLE = "SimCardSetting"; 112 const std::string SIMCARD_SETTING_URI_PATH = SIMCARD_SETTING_TABLE; 113 const std::string SIMCARD_SETTING_PATH_URI = RINGTONE_URI + "/" + SIMCARD_SETTING_URI_PATH; 114 // simcard setting table column name 115 const std::string SIMCARD_SETTING_COLUMN_MODE = "mode"; 116 const std::string SIMCARD_SETTING_COLUMN_TONE_FILE = "tone_file"; 117 const std::string SIMCARD_SETTING_COLUMN_RINGTONE_TYPE = "ringtone_type"; 118 const std::string SIMCARD_SETTING_COLUMN_VIBRATE_FILE = "vibrate_file"; 119 const std::string SIMCARD_SETTING_COLUMN_VIBRATE_MODE = "vibrate_mode"; 120 const std::string SIMCARD_SETTING_COLUMN_RING_MODE = "ring_mode"; 121 122 // vibrate table name 123 const std::string VIBRATE_TABLE = "VibrateFiles"; 124 // vibrate table column name 125 const std::string VIBRATE_COLUMN_VIBRATE_ID = "vibrate_id"; 126 const std::string VIBRATE_COLUMN_DATA = "data"; 127 const std::string VIBRATE_COLUMN_SIZE = "size"; 128 const std::string VIBRATE_COLUMN_DISPLAY_NAME = "display_name"; 129 const std::string VIBRATE_COLUMN_TITLE = "title"; 130 const std::string VIBRATE_COLUMN_DISPLAY_LANGUAGE = "display_language"; 131 const std::string VIBRATE_COLUMN_VIBRATE_TYPE = "vibrate_type"; 132 const std::string VIBRATE_COLUMN_SOURCE_TYPE = "source_type"; 133 const std::string VIBRATE_COLUMN_DATE_ADDED = "date_added"; 134 const std::string VIBRATE_COLUMN_DATE_MODIFIED = "date_modified"; 135 const std::string VIBRATE_COLUMN_DATE_TAKEN = "date_taken"; 136 const std::string VIBRATE_COLUMN_PLAY_MODE = "play_mode"; 137 const std::string VIBRATE_COLUMN_SCANNER_FLAG = "scanner_flag"; 138 139 } // namespace Media 140 } // namespace OHOS 141 142 #endif // RINGTONE_DB_CONST_H 143