• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025-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 ST_AUDIO_CORE_SERVICE_UTILS_H
16 #define ST_AUDIO_CORE_SERVICE_UTILS_H
17 
18 #include <list>
19 #include <string>
20 #include <mutex>
21 
22 #include "audio_log.h"
23 #include "audio_errors.h"
24 #include "audio_device_descriptor.h"
25 #include "audio_info.h"
26 #include "audio_stream_descriptor.h"
27 #include "audio_policy_utils.h"
28 #include "audio_module_info.h"
29 
30 namespace OHOS {
31 namespace AudioStandard {
32 
33 class AudioCoreServiceUtils {
34 public:
35     static bool IsDualStreamWhenRingDual(AudioStreamType streamType);
36     static bool IsOverRunPlayback(AudioMode &mode, RendererState rendererState);
37     static bool IsRingDualToneOnPrimarySpeaker(const std::vector<std::shared_ptr<AudioDeviceDescriptor>> &descs,
38         const int32_t sessionId);
39     static bool NeedDualHalToneInStatus(AudioRingerMode mode, StreamUsage usage,
40         bool isPcVolumeEnable, bool isMusicMute);
41     static bool IsAlarmOnActive(StreamUsage usage, bool isAlarmActive);
42 };
43 }
44 }
45 #endif