1 /* 2 * Copyright (C) 2025 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 #ifndef CUSTOMISED_TONE_PROCESSOR_H 16 #define CUSTOMISED_TONE_PROCESSOR_H 17 18 #include <cstdint> 19 #include <string> 20 21 #include "dualfwk_conf_loader.h" 22 23 namespace OHOS { 24 namespace Media { 25 const std::string RINGTONE_EXTERNAL_BASE_PATH = "/storage/emulated/0"; 26 const std::string RINGTONE_EXTERNAL_MUSIC_PATH = RINGTONE_EXTERNAL_BASE_PATH + "/Music"; 27 const std::string FILE_MANAGER_BASE_PATH = "/storage/media/local/files/Docs"; 28 const std::string FILE_MANAGER_UPDATE_BACKUP_PATH = FILE_MANAGER_BASE_PATH + "/UpdateBackup"; 29 30 class CustomisedToneProcessor { 31 public: 32 CustomisedToneProcessor(); ~CustomisedToneProcessor()33 ~CustomisedToneProcessor() {}; 34 int32_t QueryFileMgrForFileInfo(std::map<std::string, std::shared_ptr<FileInfo>> &infoMap); 35 36 private: 37 int32_t GetCustomisedAudioPath(DualFwkConf &dualFwkConf); 38 std::string ConvertCustomisedAudioPath(const std::string &ringtonePath); 39 int32_t BuildFileInfo(const std::string &dualFilePath, int32_t toneType, int32_t ringtoneType, 40 int32_t shotToneType, std::vector<FileInfo> &fileInfo); 41 std::vector<FileInfo> BuildFileInfos(); 42 }; 43 } // namespace Media 44 } // namespace OHOS 45 #endif // CUSTOMISED_TONE_PROCESSOR_H