diff --git a/runtime/main/extend/systemplugin/napi/ohos_distributedHardware_deviceManager.js b/runtime/main/extend/systemplugin/napi/ohos_distributedHardware_deviceManager.js index 5b2df6cb..9947c73e 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_distributedHardware_deviceManager.js +++ b/runtime/main/extend/systemplugin/napi/ohos_distributedHardware_deviceManager.js @@ -16,6 +16,43 @@ import { paramMock } from "../utils" export function mockDeviceManager() { + const wantAgent = { + DeviceType: { + UNKNOWN_TYPE: 0, + SPEAKER: 0x0A, + PHONE: 0x0E, + TABLET: 0x11, + WEARABLE: 0x6D, + CAR: 0x83, + TV: 0x9C + }, + DeviceStateChangeAction: { + ONLINE: 0, + READY: 1, + OFFLINE: 2, + CHANGE: 3 + }, + DiscoverMode: { + DISCOVER_MODE_PASSIVE: 0x55, + DISCOVER_MODE_ACTIVE: 0xAA + }, + ExchangeMedium: { + AUTO: 0, + BLE: 1, + COAP: 2, + USB: 3 + }, + ExchangeFreq: { + LOW: 0, + MID: 1, + HIGH: 2, + SUPER_HIGH: 3 + }, + SubscribeCap: { + SUBSCRIBE_CAPABILITY_DDMP: 0, + SUBSCRIBE_CAPABILITY_OSD: 1 + }, + } const deviceInfoMock = { deviceId: "[PC Preview] unknow mDeviceId", deviceName: "[PC Preview] unknow mDeviceName", @@ -26,6 +63,24 @@ export function mockDeviceManager() { action: 0, device: deviceInfoMock } + const subscribeInfoMock = { + subscribeId: "[PC Preview] unknow mSubscribeId", + mode: "[PC Preview] unknow mMode", + medium: "[PC Preview] unknow mMedium", + freq: "[PC Preview] unknow mFreq", + isSameAccount: "[PC Preview] unknow mIsSameAccount", + isWakeRemote: "[PC Preview] unknow mIsWakeRemote", + capability: "[PC Preview] unknow mCapability" + } + const authParamMock = { + authType: "[PC Preview] unknow mAuthType", + extraInfo: "[PC Preview] unknow mExtraInfo" + } + const authInfoMock = { + authType: "[PC Preview] unknow mAuthType", + token: "[PC Preview] unknow mToken", + extraInfo: "[PC Preview] unknow mExtraInfo" + } const deviceManagerMock = { release: function () { console.warn("DeviceManager.release interface mocked in the Previewer. How this interface works on the Previewer" +