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: 39 explicit DeviceStatusCallbackImpl(); ~DeviceStatusCallbackImpl()40 ~DeviceStatusCallbackImpl() override {}; 41 void OnDeviceChanged(const DistributedHardware::DmDeviceBasicInfo &dmDeviceBasicInfo) override; OnDeviceOnline(const DistributedHardware::DmDeviceBasicInfo & deviceBasicInfo)42 void OnDeviceOnline(const DistributedHardware::DmDeviceBasicInfo &deviceBasicInfo) override {}; OnDeviceOffline(const DistributedHardware::DmDeviceBasicInfo & deviceBasicInfo)43 void OnDeviceOffline(const DistributedHardware::DmDeviceBasicInfo &deviceBasicInfo) override {}; OnDeviceReady(const DistributedHardware::DmDeviceBasicInfo & deviceBasicInfo)44 void OnDeviceReady(const DistributedHardware::DmDeviceBasicInfo &deviceBasicInfo) override {}; 45 46 private: 47 AudioPolicyService& audioPolicyService_; 48 }; 49 #endif 50 51 } // namespace AudioStandard 52 } // namespace OHOS 53 54 #endif // ST_DEVICE_INIT_CALLBACK_H 55