1 /* 2 * Copyright (c) 2023 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 #ifndef ST_DEVICE_INIT_CALLBACK_H 17 #define ST_DEVICE_INIT_CALLBACK_H 18 19 #include "audio_policy_service.h" 20 #ifdef FEATURE_DEVICE_MANAGER 21 #include "device_manager_callback.h" 22 #include "device_manager.h" 23 #endif 24 25 namespace OHOS { 26 namespace AudioStandard { 27 #ifdef FEATURE_DEVICE_MANAGER 28 class DeviceInitCallBack : public DistributedHardware::DmInitCallback { 29 public: 30 explicit DeviceInitCallBack() = default; ~DeviceInitCallBack()31 ~DeviceInitCallBack() override {}; OnRemoteDied()32 void OnRemoteDied() override {}; 33 }; 34 #endif 35 36 #ifdef FEATURE_DEVICE_MANAGER 37 class DeviceStatusCallbackImpl : public DistributedHardware::DeviceStatusCallback, 38 public DistributedHardware::DeviceStateCallback { 39 public: 40 explicit DeviceStatusCallbackImpl(); ~DeviceStatusCallbackImpl()41 ~DeviceStatusCallbackImpl() override {}; 42 void OnDeviceChanged(const DistributedHardware::DmDeviceBasicInfo &dmDeviceBasicInfo) override; OnDeviceOnline(const DistributedHardware::DmDeviceBasicInfo & deviceBasicInfo)43 void OnDeviceOnline(const DistributedHardware::DmDeviceBasicInfo &deviceBasicInfo) override {}; OnDeviceOffline(const DistributedHardware::DmDeviceBasicInfo & deviceBasicInfo)44 void OnDeviceOffline(const DistributedHardware::DmDeviceBasicInfo &deviceBasicInfo) override {}; OnDeviceReady(const DistributedHardware::DmDeviceBasicInfo & deviceBasicInfo)45 void OnDeviceReady(const DistributedHardware::DmDeviceBasicInfo &deviceBasicInfo) override {}; 46 void OnDeviceChanged(const DistributedHardware::DmDeviceInfo &dmDeviceInfo) override; 47 void OnDeviceOnline(const DistributedHardware::DmDeviceInfo &dmDeviceInfo) override; 48 void OnDeviceOffline(const DistributedHardware::DmDeviceInfo &dmDeviceInfo) override; OnDeviceReady(const DistributedHardware::DmDeviceInfo & dmDeviceInfo)49 void OnDeviceReady(const DistributedHardware::DmDeviceInfo &dmDeviceInfo) override {}; 50 51 private: 52 AudioPolicyService& audioPolicyService_; 53 }; 54 #endif 55 56 } // namespace AudioStandard 57 } // namespace OHOS 58 59 #endif // ST_DEVICE_INIT_CALLBACK_H 60