1 /* 2 * Copyright (c) 2022-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 OHOS_I_DM_SERVICE_IMPL_EXT_H 17 #define OHOS_I_DM_SERVICE_IMPL_EXT_H 18 19 #include <map> 20 #include <string> 21 #include <vector> 22 23 #include "idevice_manager_service_listener.h" 24 #include "dm_device_info.h" 25 #include "dm_device_profile_info.h" 26 27 namespace OHOS { 28 namespace DistributedHardware { 29 class IDMServiceImplExt { 30 public: ~IDMServiceImplExt()31 virtual ~IDMServiceImplExt() {} 32 33 /** 34 * @tc.name: IDMServiceImplExt::Initialize 35 * @tc.desc: Initialize the device manager service impl ext 36 * @tc.type: FUNC 37 */ 38 virtual int32_t Initialize(const std::shared_ptr<IDeviceManagerServiceListener> &listener) = 0; 39 40 /** 41 * @tc.name: IDMServiceImplExt::Release 42 * @tc.desc: Release the device manager service impl ext 43 * @tc.type: FUNC 44 */ 45 virtual int32_t Release() = 0; 46 47 /** 48 * @tc.name: IDMServiceImplExt::BindTargetExt 49 * @tc.desc: BindTargetExt 50 * @tc.type: FUNC 51 */ 52 virtual int32_t BindTargetExt(const std::string &pkgName, const PeerTargetId &targetId, 53 const std::map<std::string, std::string> &bindParam) = 0; 54 55 /** 56 * @tc.name: IDMServiceImplExt::UnbindTargetExt 57 * @tc.desc: UnbindTargetExt 58 * @tc.type: FUNC 59 */ 60 virtual int32_t UnbindTargetExt(const std::string &pkgName, const PeerTargetId &targetId, 61 const std::map<std::string, std::string> &unbindParam) = 0; 62 63 /** 64 * @tc.name: IDMServiceImplExt::HandleDeviceStatusChange 65 * @tc.desc: HandleDeviceStatusChange 66 * @tc.type: FUNC 67 */ 68 virtual int32_t HandleDeviceStatusChange(DmDeviceState devState, const DmDeviceInfo &devInfo) = 0; 69 70 /** 71 * @tc.name: IDMServiceImplExt::ReplyUiAction 72 * @tc.desc: ReplyUiAction 73 * @tc.type: FUNC 74 */ 75 virtual int32_t ReplyUiAction(const std::string &pkgName, int32_t action, const std::string &result) = 0; 76 77 /** 78 * @tc.name: IDMServiceImplExt::AccountIdLogout 79 * @tc.desc: AccountIdLogout 80 * @tc.type: FUNC 81 */ 82 virtual int32_t AccountIdLogout(int32_t userId, const std::string &oldAccountId) = 0; 83 /** 84 * @tc.name: IDMServiceImplExt::HandleDeviceNotTrust 85 * @tc.desc: HandleDeviceNotTrust 86 * @tc.type: FUNC 87 */ 88 virtual void HandleDeviceNotTrust(const std::string &udid) = 0; 89 90 /** 91 * @tc.name: IDMServiceImplExt::SetDnPolicy 92 * @tc.desc: SetDnPolicy 93 * @tc.type: FUNC 94 */ 95 virtual int32_t SetDnPolicy(int32_t policy, int32_t timeOut) = 0; 96 97 /** 98 * @tc.name: IDMServiceImplExt::AccountUserSwitched 99 * @tc.desc: AccountUserSwitched 100 * @tc.type: FUNC 101 */ 102 virtual int32_t AccountUserSwitched(int32_t userId, const std::string &accountId) = 0; 103 104 /** 105 * @tc.name: IDMServiceImplExt::GetDeviceProfileInfoList 106 * @tc.desc: GetDeviceProfileInfoList 107 * @tc.type: FUNC 108 */ 109 virtual int32_t GetDeviceProfileInfoList(const std::string &pkgName, 110 const DmDeviceProfileInfoFilterOptions &filterOptions) = 0; 111 }; 112 113 using CreateDMServiceImplExtFuncPtr = IDMServiceImplExt *(*)(void); 114 } // namespace DistributedHardware 115 } // namespace OHOS 116 #endif // OHOS_I_DM_SERVICE_IMPL_EXT_H 117