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