• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 LOG_TAG
16 #define LOG_TAG "AudioA2dpOffloadFlag"
17 #endif
18 
19 #include "audio_a2dp_offload_flag.h"
20 #include <ability_manager_client.h>
21 #include "iservice_registry.h"
22 #include "parameter.h"
23 #include "parameters.h"
24 #include "audio_policy_log.h"
25 #include "audio_inner_call.h"
26 #include "media_monitor_manager.h"
27 
28 namespace OHOS {
29 namespace AudioStandard {
30 
OffloadStopPlaying(const std::vector<int32_t> & sessionIds)31 int32_t AudioA2dpOffloadFlag::OffloadStopPlaying(const std::vector<int32_t> &sessionIds)
32 {
33     return Bluetooth::AudioA2dpManager::OffloadStopPlaying(sessionIds);
34 }
35 
SetA2dpOffloadFlag(BluetoothOffloadState state)36 void AudioA2dpOffloadFlag::SetA2dpOffloadFlag(BluetoothOffloadState state)
37 {
38     a2dpOffloadFlag_ = state;
39 }
40 
GetA2dpOffloadFlag()41 BluetoothOffloadState AudioA2dpOffloadFlag::GetA2dpOffloadFlag()
42 {
43     return a2dpOffloadFlag_;
44 }
45 
OffloadStartPlaying(const std::vector<int32_t> & sessionIds)46 int32_t AudioA2dpOffloadFlag::OffloadStartPlaying(const std::vector<int32_t> &sessionIds)
47 {
48     return Bluetooth::AudioA2dpManager::OffloadStartPlaying(sessionIds);
49 }
50 
GetCurrentOffloadConnectedState()51 A2dpOffloadConnectionState AudioA2dpOffloadFlag::GetCurrentOffloadConnectedState()
52 {
53     return currentOffloadConnectionState_;
54 }
55 
SetCurrentOffloadConnectedState(A2dpOffloadConnectionState currentOffloadConnectionState)56 void AudioA2dpOffloadFlag::SetCurrentOffloadConnectedState(A2dpOffloadConnectionState currentOffloadConnectionState)
57 {
58     currentOffloadConnectionState_ = currentOffloadConnectionState;
59 }
60 
IsA2dpOffloadConnected()61 bool AudioA2dpOffloadFlag::IsA2dpOffloadConnected()
62 {
63     return currentOffloadConnectionState_ == CONNECTION_STATUS_CONNECTED;
64 }
65 
66 }
67 }