diff --git a/runtime/main/extend/systemplugin/napi/ohos_distributedHardware_deviceManager.js b/runtime/main/extend/systemplugin/napi/ohos_distributedHardware_deviceManager.js index 03c9826b..2f47e96d 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_distributedHardware_deviceManager.js +++ b/runtime/main/extend/systemplugin/napi/ohos_distributedHardware_deviceManager.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -70,6 +70,12 @@ export function mockDeviceManager() { isWakeRemote: "[PC Preview] unknow mIsWakeRemote", capability: SubscribeCap } + const PublishInfo = { + publishId: "[PC Preview] unknow mPublishId", + mode: DiscoverMode, + freq: ExchangeFreq, + ranging : "[PC Preview] unknow mRanging" + } const AuthParam = { authType: "[PC Preview] unknow mAuthType", extraInfo: {"key":"unknow any"} @@ -130,6 +136,14 @@ export function mockDeviceManager() { console.warn("DeviceManager.stopDeviceDiscovery interface mocked in the Previewer. How this interface works on the" + " Previewer may be different from that on a real device.") }, + publishDeviceDiscovery: function (...args) { + console.warn("DeviceManager.publishDeviceDiscovery interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, + unPublishDeviceDiscovery: function (...args) { + console.warn("DeviceManager.unPublishDeviceDiscovery interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + }, authenticateDevice: function (...args) { console.warn("DeviceManager.authenticateDevice interface mocked in the Previewer. How this interface works on the" + " Previewer may be different from that on a real device.") @@ -173,6 +187,15 @@ export function mockDeviceManager() { subscribeId: "[PC Preview] unknow subscribeId", reason: "[PC Preview] unknow reason" }); + } else if (args[0] == 'publishSuccess') { + args[len - 1].call(this, paramMock.businessErrorMock, { + publishId: "[PC Preview] unknow publishId", + }); + } else if (args[0] == 'publishFail') { + args[len - 1].call(this, paramMock.businessErrorMock, { + publishId: "[PC Preview] unknow publishId", + reason: "[PC Preview] unknow reason" + }); } else { args[len - 1].call(this); } @@ -191,6 +214,7 @@ export function mockDeviceManager() { ExchangeFreq, SubscribeCap, SubscribeInfo, + PublishInfo, AuthParam, AuthInfo, createDeviceManager: function (...args) {