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