• 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 // ringtone user customized tones file location
33 const std::string RINGTONE_CUSTOMIZED_BASE_PATH          = "/storage/media/local/files";
34 const std::string RINGTONE_CUSTOMIZED_ALARM_PATH         = RINGTONE_CUSTOMIZED_BASE_PATH + "/Ringtone/alarms";
35 const std::string RINGTONE_CUSTOMIZED_RINGTONE_PATH      = RINGTONE_CUSTOMIZED_BASE_PATH + "/Ringtone/ringtones";
36 const std::string RINGTONE_CUSTOMIZED_NOTIFICATIONS_PATH = RINGTONE_CUSTOMIZED_BASE_PATH + "/Ringtone/notifications";
37 const std::string RINGTONE_CUSTOMIZED_BASE_RINGTONE_PATH = "/storage/media/local/files/Ringtone";
38 const std::string RINGTONE_CUSTOMIZED_BASE_RINGTONETMP_PATH = "/storage/media/local/files/RingtoneTmp";
39 
40 // ringtone preload pathes
41 const std::string ROOT_TONE_PRELOAD_PATH_NOAH_PATH = "/sys_prod/resource/media/audio";
42 const std::string ROOT_TONE_PRELOAD_PATH_CHINA_PATH = "/sys_prod/variant/region_comm/china/resource/media/audio";
43 const std::string ROOT_TONE_PRELOAD_PATH_OVERSEA_PATH = "/sys_prod/variant/region_comm/oversea/resource/media/audio";
44 
45 // ringtone DB file path
46 const std::string RINGTONE_LIBRARY_DB_PATH = "/data/storage/el2/database";
47 
48 // ringtone DB file name
49 const std::string RINGTONE_LIBRARY_DB_NAME = "ringtone_library.db";
50 
51 // ringtone db version
52 const int32_t RINGTONE_RDB_VERSION = 4;
53 enum {
54     VERSION_ADD_DISPLAY_LANGUAGE_COLUMN = 2,
55     VERSION_UPDATE_MIME_TYPE,
56     VERSION_ADD_PRELOAD_CONF_TABLE,
57 };
58 
59 // ringtone table name
60 const std::string RINGTONE_TABLE                                = "ToneFiles";
61 // ringtone table column name
62 const std::string RINGTONE_COLUMN_TONE_ID                       = "tone_id";
63 const std::string RINGTONE_COLUMN_DATA                          = "data";
64 const std::string RINGTONE_COLUMN_SIZE                          = "size";
65 const std::string RINGTONE_COLUMN_DISPLAY_NAME                  = "display_name";
66 const std::string RINGTONE_COLUMN_TITLE                         = "title";
67 const std::string RINGTONE_COLUMN_MEDIA_TYPE                    = "media_type";
68 const std::string RINGTONE_COLUMN_TONE_TYPE                     = "tone_type";
69 const std::string RINGTONE_COLUMN_MIME_TYPE                     = "mime_type";
70 const std::string RINGTONE_COLUMN_SOURCE_TYPE                   = "source_type";
71 const std::string RINGTONE_COLUMN_DATE_ADDED                    = "date_added";
72 const std::string RINGTONE_COLUMN_DATE_MODIFIED                 = "date_modified";
73 const std::string RINGTONE_COLUMN_DATE_TAKEN                    = "date_taken";
74 const std::string RINGTONE_COLUMN_DURATION                      = "duration";
75 const std::string RINGTONE_COLUMN_SHOT_TONE_TYPE                = "shot_tone_type";
76 const std::string RINGTONE_COLUMN_SHOT_TONE_SOURCE_TYPE         = "shot_tone_source_type";
77 const std::string RINGTONE_COLUMN_NOTIFICATION_TONE_TYPE        = "notification_tone_type";
78 const std::string RINGTONE_COLUMN_NOTIFICATION_TONE_SOURCE_TYPE = "notification_tone_source_type";
79 const std::string RINGTONE_COLUMN_RING_TONE_TYPE                = "ring_tone_type";
80 const std::string RINGTONE_COLUMN_RING_TONE_SOURCE_TYPE         = "ring_tone_source_type";
81 const std::string RINGTONE_COLUMN_ALARM_TONE_TYPE               = "alarm_tone_type";
82 const std::string RINGTONE_COLUMN_ALARM_TONE_SOURCE_TYPE        = "alarm_tone_source_type";
83 const std::string RINGTONE_COLUMN_DISPLAY_LANGUAGE_TYPE         = "display_language_type";
84 
85 // preload config table name
86 const std::string PRELOAD_CONFIG_TABLE                          = "PreloadConfig";
87 
88 // preload config column name
89 const std::string PRELOAD_CONFIG_COLUMN_RING_TONE_TYPE          = "ring_tone_type";
90 const std::string PRELOAD_CONFIG_COLUMN_TONE_ID                 = "tone_id";
91 const std::string PRELOAD_CONFIG_COLUMN_DISPLAY_NAME            = "display_name";
92 } // namespace Media
93 } // namespace OHOS
94 
95 #endif // RINGTONE_DB_CONST_H
96