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 #ifndef POWERMGR_BATTERY_MANAGER_CHARGING_SOUND_H 16 #define POWERMGR_BATTERY_MANAGER_CHARGING_SOUND_H 17 #include <string> 18 #include "nocopyable.h" 19 namespace OHOS { 20 namespace Media { 21 class AudioHapticSound; 22 } // namespace Media 23 24 namespace PowerMgr { 25 class ChargingSoundCallBack; 26 class ChargingSound { 27 public: 28 static ChargingSound& GetInstance(); 29 void Start() const; 30 void Stop() const; 31 void Prepare() const; 32 33 private: 34 ChargingSound(); 35 DISALLOW_COPY_AND_MOVE(ChargingSound); 36 std::string GetPath(const char* uri) const; 37 std::string uri_; 38 std::shared_ptr<Media::AudioHapticSound> sound_ {}; 39 std::shared_ptr<ChargingSoundCallBack> callback_ {}; 40 }; 41 } // namespace PowerMgr 42 } // namespace OHOS 43 #endif