• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 = 9;
67 enum {
68     VERSION_ADD_DISPLAY_LANGUAGE_COLUMN = 2,
69     VERSION_ADD_VIBRATE_TABLE = 3,
70     VERSION_UPDATE_MIME_TYPE = 4,
71     VERSION_ADD_PRELOAD_CONF_TABLE = 5,
72     VERSION_UPDATE_WATCH_MIME_TYPE = 6,
73     VERSION_ADD_SCANNER_FLAG = 7,
74     VERSION_UPDATE_MEDIA_TYPE_VIDEO = 8,
75     VERSION_UPDATE_DATA_URI = 9,
76 };
77 
78 // ringtone table name
79 const std::string RINGTONE_TABLE                                = "ToneFiles";
80 // ringtone table column name
81 const std::string RINGTONE_COLUMN_TONE_ID                       = "tone_id";
82 const std::string RINGTONE_COLUMN_DATA                          = "data";
83 const std::string RINGTONE_COLUMN_SIZE                          = "size";
84 const std::string RINGTONE_COLUMN_DISPLAY_NAME                  = "display_name";
85 const std::string RINGTONE_COLUMN_TITLE                         = "title";
86 const std::string RINGTONE_COLUMN_MEDIA_TYPE                    = "media_type";
87 const std::string RINGTONE_COLUMN_TONE_TYPE                     = "tone_type";
88 const std::string RINGTONE_COLUMN_MIME_TYPE                     = "mime_type";
89 const std::string RINGTONE_COLUMN_SOURCE_TYPE                   = "source_type";
90 const std::string RINGTONE_COLUMN_DATE_ADDED                    = "date_added";
91 const std::string RINGTONE_COLUMN_DATE_MODIFIED                 = "date_modified";
92 const std::string RINGTONE_COLUMN_DATE_TAKEN                    = "date_taken";
93 const std::string RINGTONE_COLUMN_DURATION                      = "duration";
94 const std::string RINGTONE_COLUMN_SHOT_TONE_TYPE                = "shot_tone_type";
95 const std::string RINGTONE_COLUMN_SHOT_TONE_SOURCE_TYPE         = "shot_tone_source_type";
96 const std::string RINGTONE_COLUMN_NOTIFICATION_TONE_TYPE        = "notification_tone_type";
97 const std::string RINGTONE_COLUMN_NOTIFICATION_TONE_SOURCE_TYPE = "notification_tone_source_type";
98 const std::string RINGTONE_COLUMN_RING_TONE_TYPE                = "ring_tone_type";
99 const std::string RINGTONE_COLUMN_RING_TONE_SOURCE_TYPE         = "ring_tone_source_type";
100 const std::string RINGTONE_COLUMN_ALARM_TONE_TYPE               = "alarm_tone_type";
101 const std::string RINGTONE_COLUMN_ALARM_TONE_SOURCE_TYPE        = "alarm_tone_source_type";
102 const std::string RINGTONE_COLUMN_DISPLAY_LANGUAGE_TYPE         = "display_language_type";
103 const std::string RINGTONE_COLUMN_SCANNER_FLAG                  = "scanner_flag";
104 
105 // simcard setting table name
106 const std::string SIMCARD_SETTING_TABLE                         = "SimCardSetting";
107 const std::string SIMCARD_SETTING_URI_PATH                      = SIMCARD_SETTING_TABLE;
108 const std::string SIMCARD_SETTING_PATH_URI                      = RINGTONE_URI + "/" + SIMCARD_SETTING_URI_PATH;
109 // simcard setting table column name
110 const std::string SIMCARD_SETTING_COLUMN_MODE                   = "mode";
111 const std::string SIMCARD_SETTING_COLUMN_TONE_FILE              = "tone_file";
112 const std::string SIMCARD_SETTING_COLUMN_RINGTONE_TYPE          = "ringtone_type";
113 const std::string SIMCARD_SETTING_COLUMN_VIBRATE_FILE           = "vibrate_file";
114 const std::string SIMCARD_SETTING_COLUMN_VIBRATE_MODE           = "vibrate_mode";
115 const std::string SIMCARD_SETTING_COLUMN_RING_MODE              = "ring_mode";
116 
117 // vibrate table name
118 const std::string VIBRATE_TABLE                                 = "VibrateFiles";
119 // vibrate table column name
120 const std::string VIBRATE_COLUMN_VIBRATE_ID                     = "vibrate_id";
121 const std::string VIBRATE_COLUMN_DATA                           = "data";
122 const std::string VIBRATE_COLUMN_SIZE                           = "size";
123 const std::string VIBRATE_COLUMN_DISPLAY_NAME                   = "display_name";
124 const std::string VIBRATE_COLUMN_TITLE                          = "title";
125 const std::string VIBRATE_COLUMN_DISPLAY_LANGUAGE               = "display_language";
126 const std::string VIBRATE_COLUMN_VIBRATE_TYPE                   = "vibrate_type";
127 const std::string VIBRATE_COLUMN_SOURCE_TYPE                    = "source_type";
128 const std::string VIBRATE_COLUMN_DATE_ADDED                     = "date_added";
129 const std::string VIBRATE_COLUMN_DATE_MODIFIED                  = "date_modified";
130 const std::string VIBRATE_COLUMN_DATE_TAKEN                     = "date_taken";
131 const std::string VIBRATE_COLUMN_PLAY_MODE                      = "play_mode";
132 const std::string VIBRATE_COLUMN_SCANNER_FLAG                   = "scanner_flag";
133 
134 // preload config table name
135 const std::string PRELOAD_CONFIG_TABLE                          = "PreloadConfig";
136 
137 // preload config column name
138 const std::string PRELOAD_CONFIG_COLUMN_RING_TONE_TYPE          = "ring_tone_type";
139 const std::string PRELOAD_CONFIG_COLUMN_TONE_ID                 = "tone_id";
140 const std::string PRELOAD_CONFIG_COLUMN_DISPLAY_NAME            = "display_name";
141 
142 } // namespace Media
143 } // namespace OHOS
144 
145 #endif // RINGTONE_DB_CONST_H
146