• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 #include "bluetooth_a2dp_src_observer.h"
17 #include <hdf_log.h>
18 
OnConnectionStateChanged(const bluetooth::RawAddress & device,int state)19 void BluetoothA2dpSrcObserver::OnConnectionStateChanged(const bluetooth::RawAddress &device, int state)
20 {
21     HDF_LOGI("BluetoothA2dpSrcObserver::OnConnectionStateChanged");
22     if ((callbacks_ != nullptr) && (callbacks_->OnConnectionStateChanged)) {
23         callbacks_->OnConnectionStateChanged(device, state);
24     }
25 }
26 
OnPlayingStatusChanged(const bluetooth::RawAddress & device,int playingState,int error)27 void BluetoothA2dpSrcObserver::OnPlayingStatusChanged(const bluetooth::RawAddress &device, int playingState, int error)
28 {
29     HDF_LOGI("BluetoothA2dpSrcObserver::OnPlayingStatusChanged");
30     if ((callbacks_ != nullptr) && (callbacks_->OnPlayingStatusChanged)) {
31         callbacks_->OnPlayingStatusChanged(device, playingState, error);
32     }
33 }
34 
OnConfigurationChanged(const bluetooth::RawAddress & device,const OHOS::Bluetooth::BluetoothA2dpCodecInfo & info,int error)35 void BluetoothA2dpSrcObserver::OnConfigurationChanged
36     (const bluetooth::RawAddress &device, const OHOS::Bluetooth::BluetoothA2dpCodecInfo &info, int error)
37 {
38     HDF_LOGI("BluetoothA2dpSrcObserver::OnConfigurationChanged");
39     if ((callbacks_ != nullptr) && (callbacks_->OnConfigurationChanged)) {
40         callbacks_->OnConfigurationChanged(device, info, error);
41     }
42 }