diff --git a/runtime/main/extend/systemplugin/napi/ohos_rpc.js b/runtime/main/extend/systemplugin/napi/ohos_rpc.js index 62d500f564f30e0e0d47fc62469ff397750b856d..c2e1bc07080cc49d5b87a4c5038779803ec04472 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_rpc.js +++ b/runtime/main/extend/systemplugin/napi/ohos_rpc.js @@ -508,6 +508,13 @@ export const RemoteObjectClass = class RemoteObject { }) } }; + this.sendRequestAsync = function (...args) { + console.warn("RemoteObject.sendRequestAsync interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return new Promise((resolve, reject) => { + resolve(SendRequestResultMock) + }) + }; this.getCallingPid = function () { console.warn("RemoteObject.getCallingPid interface mocked in the Previewer. How this interface works on the" + " Previewer may be different from that on a real device.") @@ -580,6 +587,13 @@ export const RemoteProxyClass = class RemoteProxy { }) } }; + this.sendRequestAsync = function (...args) { + console.warn("RemoteProxy.sendRequestAsync mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return new Promise((resolve, reject) => { + resolve(SendRequestResultMock) + }) + }; this.PING_TRANSACTION = ('_'.charCodeAt(0) << 24) | ('P'.charCodeAt(0) << 16) | ('N'.charCodeAt(0) << 8) | 'G'.charCodeAt(0); this.DUMP_TRANSACTION = ('_'.charCodeAt(0) << 24) | ('D'.charCodeAt(0) << 16) | @@ -608,6 +622,13 @@ export const IRemoteObjectMock = { }) } }, + sendRequestAsync: function (...args) { + console.warn("IRemoteObject.sendRequestAsync interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + return new Promise((resolve, reject) => { + resolve(SendRequestResultMock) + }) + }, addDeathRecipient: function (...args) { console.warn("IRemoteObject.addDeathRecipient interface mocked in the Previewer. How this interface works on the" + " Previewer may be different from that on a real device.")