From 7f69923f8a81ebb1fe32b635bc77d14655bb2148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E6=A0=B9=E5=A0=82?= Date: Tue, 12 Jul 2022 12:10:05 +0000 Subject: [PATCH] update runtime/main/extend/systemplugin/napi/ohos_rpc.js. Signed-off-by: magentang --- .../main/extend/systemplugin/napi/ohos_rpc.js | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/runtime/main/extend/systemplugin/napi/ohos_rpc.js b/runtime/main/extend/systemplugin/napi/ohos_rpc.js index a5141d9c..f8f0d322 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_rpc.js +++ b/runtime/main/extend/systemplugin/napi/ohos_rpc.js @@ -428,12 +428,12 @@ export const MessageOptionClass = class MessageOption { console.warn("MessageOption.setWaitTime interface mocked in the Previewer. How this interface works on the" + " Previewer may be different from that on a real device.") }; + this.TF_SYNC = 0; + this.TF_ASYNC = 1; + this.TF_ACCEPT_FDS = 0x10; + this.TF_WAIT_TIME = 4; } }; -MessageOptionClass.TF_SYNC = '[PC preview] unknow TF_SYNC'; -MessageOptionClass.TF_ASYNC = '[PC preview] unknow TF_ASYNC'; -MessageOptionClass.TF_ACCEPT_FDS = '[PC preview] unknow TF_ACCEPT_FDS'; -MessageOptionClass.TF_WAIT_TIME = '[PC preview] unknow TF_WAIT_TIME'; export const AshmemClass = class Ashmem { constructor() { console.warn('rpc.Ashmem constructor interface mocked in the Previewer. How this interface works on the' + @@ -481,6 +481,10 @@ export const AshmemClass = class Ashmem { ' Previewer may be different from that on a real device.') return paramMock.paramArrayMock }; + this.PROT_EXEC = 4; + this.PROT_NONE = 0; + this.PROT_READ = 1; + this.PROT_WRITE = 2; } }; AshmemClass.createAshmem = function (...args) { @@ -493,10 +497,6 @@ AshmemClass.createAshmemFromExisting = function (...args) { ' Previewer may be different from that on a real device.') return new AshmemClass() }; -AshmemClass.PROT_EXEC = '[PC preview] unknow PROT_EXEC'; -AshmemClass.PROT_NONE = '[PC preview] unknow PROT_NONE'; -AshmemClass.PROT_READ = '[PC preview] unknow PROT_READ'; -AshmemClass.PROT_WRITE = '[PC preview] unknow PROT_WRITE'; export const RemoteObjectClass = class RemoteObject { constructor(...args) { console.warn("rpc.RemoteObject constructor interface mocked in the Previewer. How this interface works on the" + @@ -600,13 +600,16 @@ export const RemoteProxyClass = class RemoteProxy { }) } }; + 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) | + ('M'.charCodeAt(0) << 8) | 'P'.charCodeAt(0); + this.INTERFACE_TRANSACTION = ('_'.charCodeAt(0) << 24) | ('N'.charCodeAt(0) << 16) | + ('T'.charCodeAt(0) << 8) | 'F'.charCodeAt(0); + this.MIN_TRANSACTION_ID = 0x1; + this.MAX_TRANSACTION_ID = 0x00FFFFFF; } }; -RemoteProxyClass.PING_TRANSACTION = '[PC preview] unknow PING_TRANSACTION'; -RemoteProxyClass.DUMP_TRANSACTION = '[PC preview] unknow DUMP_TRANSACTION'; -RemoteProxyClass.INTERFACE_TRANSACTION = '[PC preview] unknow INTERFACE_TRANSACTION'; -RemoteProxyClass.MIN_TRANSACTION_ID = '[PC preview] unknow MIN_TRANSACTION_ID'; -RemoteProxyClass.MAX_TRANSACTION_ID = '[PC preview] unknow MAX_TRANSACTION_ID'; export const IRemoteObjectMock = { queryLocalInterface: function (...args) { console.warn("IRemoteObject.queryLocalInterface interface mocked in the Previewer. How this interface works on the" +