161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (C) 2021-2023 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit IPCKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport type { AsyncCallback } from './@ohos.base'; 2261847f8eSopenharmony_ci 2361847f8eSopenharmony_ci/** 2461847f8eSopenharmony_ci * This module provides inter process communication capability. 2561847f8eSopenharmony_ci * 2661847f8eSopenharmony_ci * @namespace rpc 2761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 2861847f8eSopenharmony_ci * @since 7 2961847f8eSopenharmony_ci */ 3061847f8eSopenharmony_cideclare namespace rpc { 3161847f8eSopenharmony_ci /** 3261847f8eSopenharmony_ci * The error code of rpc. 3361847f8eSopenharmony_ci * 3461847f8eSopenharmony_ci * @enum { number } 3561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 3661847f8eSopenharmony_ci * @since 9 3761847f8eSopenharmony_ci */ 3861847f8eSopenharmony_ci enum ErrorCode { 3961847f8eSopenharmony_ci /** 4061847f8eSopenharmony_ci * Parameter error. 4161847f8eSopenharmony_ci * 4261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 4361847f8eSopenharmony_ci * @since 9 4461847f8eSopenharmony_ci */ 4561847f8eSopenharmony_ci CHECK_PARAM_ERROR = 401, 4661847f8eSopenharmony_ci 4761847f8eSopenharmony_ci /** 4861847f8eSopenharmony_ci * Failed to call mmap. 4961847f8eSopenharmony_ci * 5061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 5161847f8eSopenharmony_ci * @since 9 5261847f8eSopenharmony_ci */ 5361847f8eSopenharmony_ci OS_MMAP_ERROR = 1900001, 5461847f8eSopenharmony_ci 5561847f8eSopenharmony_ci /** 5661847f8eSopenharmony_ci * Failed to call ioctl. 5761847f8eSopenharmony_ci * 5861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 5961847f8eSopenharmony_ci * @since 9 6061847f8eSopenharmony_ci */ 6161847f8eSopenharmony_ci OS_IOCTL_ERROR = 1900002, 6261847f8eSopenharmony_ci 6361847f8eSopenharmony_ci /** 6461847f8eSopenharmony_ci * Failed to write data to the shared memory. 6561847f8eSopenharmony_ci * 6661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 6761847f8eSopenharmony_ci * @since 9 6861847f8eSopenharmony_ci */ 6961847f8eSopenharmony_ci WRITE_TO_ASHMEM_ERROR = 1900003, 7061847f8eSopenharmony_ci 7161847f8eSopenharmony_ci /** 7261847f8eSopenharmony_ci * Failed to read data from the shared memory. 7361847f8eSopenharmony_ci * 7461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 7561847f8eSopenharmony_ci * @since 9 7661847f8eSopenharmony_ci */ 7761847f8eSopenharmony_ci READ_FROM_ASHMEM_ERROR = 1900004, 7861847f8eSopenharmony_ci 7961847f8eSopenharmony_ci /** 8061847f8eSopenharmony_ci * Operation allowed only for the proxy object. 8161847f8eSopenharmony_ci * 8261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 8361847f8eSopenharmony_ci * @since 9 8461847f8eSopenharmony_ci */ 8561847f8eSopenharmony_ci ONLY_PROXY_OBJECT_PERMITTED_ERROR = 1900005, 8661847f8eSopenharmony_ci 8761847f8eSopenharmony_ci /** 8861847f8eSopenharmony_ci * Operation allowed only for the remote object. 8961847f8eSopenharmony_ci * 9061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 9161847f8eSopenharmony_ci * @since 9 9261847f8eSopenharmony_ci */ 9361847f8eSopenharmony_ci ONLY_REMOTE_OBJECT_PERMITTED_ERROR = 1900006, 9461847f8eSopenharmony_ci 9561847f8eSopenharmony_ci /** 9661847f8eSopenharmony_ci * Communication failed. 9761847f8eSopenharmony_ci * 9861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 9961847f8eSopenharmony_ci * @since 9 10061847f8eSopenharmony_ci */ 10161847f8eSopenharmony_ci COMMUNICATION_ERROR = 1900007, 10261847f8eSopenharmony_ci 10361847f8eSopenharmony_ci /** 10461847f8eSopenharmony_ci * The proxy or remote object is invalid. 10561847f8eSopenharmony_ci * 10661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 10761847f8eSopenharmony_ci * @since 9 10861847f8eSopenharmony_ci */ 10961847f8eSopenharmony_ci PROXY_OR_REMOTE_OBJECT_INVALID_ERROR = 1900008, 11061847f8eSopenharmony_ci 11161847f8eSopenharmony_ci /** 11261847f8eSopenharmony_ci * Failed to write data to the message sequence. 11361847f8eSopenharmony_ci * 11461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 11561847f8eSopenharmony_ci * @since 9 11661847f8eSopenharmony_ci */ 11761847f8eSopenharmony_ci WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR = 1900009, 11861847f8eSopenharmony_ci 11961847f8eSopenharmony_ci /** 12061847f8eSopenharmony_ci * Failed to read data from the message sequence. 12161847f8eSopenharmony_ci * 12261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 12361847f8eSopenharmony_ci * @since 9 12461847f8eSopenharmony_ci */ 12561847f8eSopenharmony_ci READ_DATA_FROM_MESSAGE_SEQUENCE_ERROR = 1900010, 12661847f8eSopenharmony_ci 12761847f8eSopenharmony_ci /** 12861847f8eSopenharmony_ci * Memory allocation failed. 12961847f8eSopenharmony_ci * 13061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 13161847f8eSopenharmony_ci * @since 9 13261847f8eSopenharmony_ci */ 13361847f8eSopenharmony_ci PARCEL_MEMORY_ALLOC_ERROR = 1900011, 13461847f8eSopenharmony_ci 13561847f8eSopenharmony_ci /** 13661847f8eSopenharmony_ci * Call js method failed 13761847f8eSopenharmony_ci * 13861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 13961847f8eSopenharmony_ci * @since 9 14061847f8eSopenharmony_ci */ 14161847f8eSopenharmony_ci CALL_JS_METHOD_ERROR = 1900012, 14261847f8eSopenharmony_ci 14361847f8eSopenharmony_ci /** 14461847f8eSopenharmony_ci * Os dup function failed 14561847f8eSopenharmony_ci * 14661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 14761847f8eSopenharmony_ci * @since 9 14861847f8eSopenharmony_ci */ 14961847f8eSopenharmony_ci OS_DUP_ERROR = 1900013 15061847f8eSopenharmony_ci } 15161847f8eSopenharmony_ci 15261847f8eSopenharmony_ci /** 15361847f8eSopenharmony_ci * Enumerates the types of the TypedArray object converted from an ArrayBuffer object. 15461847f8eSopenharmony_ci * 15561847f8eSopenharmony_ci * @enum { number } 15661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 15761847f8eSopenharmony_ci * @since 12 15861847f8eSopenharmony_ci */ 15961847f8eSopenharmony_ci enum TypeCode { 16061847f8eSopenharmony_ci /** 16161847f8eSopenharmony_ci * The TypedArray type is Int8Array. 16261847f8eSopenharmony_ci * 16361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 16461847f8eSopenharmony_ci * @since 12 16561847f8eSopenharmony_ci */ 16661847f8eSopenharmony_ci INT8_ARRAY = 0, 16761847f8eSopenharmony_ci 16861847f8eSopenharmony_ci /** 16961847f8eSopenharmony_ci * The TypedArray type is Uint8Array. 17061847f8eSopenharmony_ci * 17161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 17261847f8eSopenharmony_ci * @since 12 17361847f8eSopenharmony_ci */ 17461847f8eSopenharmony_ci UINT8_ARRAY = 1, 17561847f8eSopenharmony_ci 17661847f8eSopenharmony_ci /** 17761847f8eSopenharmony_ci * The TypedArray type is Int16Array. 17861847f8eSopenharmony_ci * 17961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 18061847f8eSopenharmony_ci * @since 12 18161847f8eSopenharmony_ci */ 18261847f8eSopenharmony_ci INT16_ARRAY = 2, 18361847f8eSopenharmony_ci 18461847f8eSopenharmony_ci /** 18561847f8eSopenharmony_ci * The TypedArray type is Uint16Array. 18661847f8eSopenharmony_ci * 18761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 18861847f8eSopenharmony_ci * @since 12 18961847f8eSopenharmony_ci */ 19061847f8eSopenharmony_ci UINT16_ARRAY = 3, 19161847f8eSopenharmony_ci 19261847f8eSopenharmony_ci /** 19361847f8eSopenharmony_ci * The TypedArray type is Int32Array. 19461847f8eSopenharmony_ci * 19561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 19661847f8eSopenharmony_ci * @since 12 19761847f8eSopenharmony_ci */ 19861847f8eSopenharmony_ci INT32_ARRAY = 4, 19961847f8eSopenharmony_ci 20061847f8eSopenharmony_ci /** 20161847f8eSopenharmony_ci * The TypedArray type is Uint32Array. 20261847f8eSopenharmony_ci * 20361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 20461847f8eSopenharmony_ci * @since 12 20561847f8eSopenharmony_ci */ 20661847f8eSopenharmony_ci UINT32_ARRAY = 5, 20761847f8eSopenharmony_ci 20861847f8eSopenharmony_ci /** 20961847f8eSopenharmony_ci * The TypedArray type is Float32Array. 21061847f8eSopenharmony_ci * 21161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 21261847f8eSopenharmony_ci * @since 12 21361847f8eSopenharmony_ci */ 21461847f8eSopenharmony_ci FLOAT32_ARRAY = 6, 21561847f8eSopenharmony_ci 21661847f8eSopenharmony_ci /** 21761847f8eSopenharmony_ci * The TypedArray type is Float64Array. 21861847f8eSopenharmony_ci * 21961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 22061847f8eSopenharmony_ci * @since 12 22161847f8eSopenharmony_ci */ 22261847f8eSopenharmony_ci FLOAT64_ARRAY = 7, 22361847f8eSopenharmony_ci 22461847f8eSopenharmony_ci /** 22561847f8eSopenharmony_ci * The TypedArray type is BigInt64Array. 22661847f8eSopenharmony_ci * 22761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 22861847f8eSopenharmony_ci * @since 12 22961847f8eSopenharmony_ci */ 23061847f8eSopenharmony_ci BIGINT64_ARRAY = 8, 23161847f8eSopenharmony_ci 23261847f8eSopenharmony_ci /** 23361847f8eSopenharmony_ci * The TypedArray type is BigUint64Array. 23461847f8eSopenharmony_ci * 23561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 23661847f8eSopenharmony_ci * @since 12 23761847f8eSopenharmony_ci */ 23861847f8eSopenharmony_ci BIGUINT64_ARRAY = 9 23961847f8eSopenharmony_ci } 24061847f8eSopenharmony_ci 24161847f8eSopenharmony_ci /** 24261847f8eSopenharmony_ci * A data object used for remote procedure call (RPC). 24361847f8eSopenharmony_ci * <p> 24461847f8eSopenharmony_ci * During RPC, the sender can use the write methods provided by {@link MessageParcel} to 24561847f8eSopenharmony_ci * write the to-be-sent data into a {@link MessageParcel} object in a specific format, and the receiver can use the 24661847f8eSopenharmony_ci * read methods provided by {@link MessageParcel} to read data of the specific format from the 24761847f8eSopenharmony_ci * {@link MessageParcel} object. 24861847f8eSopenharmony_ci * <p> 24961847f8eSopenharmony_ci * <p> 25061847f8eSopenharmony_ci * The default capacity of a {@link MessageParcel} instance is 200KB. If you want more or less, 25161847f8eSopenharmony_ci * use {@link #setCapacity(int)} to change it. 25261847f8eSopenharmony_ci * </p> 25361847f8eSopenharmony_ci * <b>Note</b>: Only data of the following data types can be written into or read from a {@link MessageParcel}: byte, 25461847f8eSopenharmony_ci * byteArray, short, shortArray, int, intArray, long, longArray, float, floatArray, double, doubleArray, boolean, 25561847f8eSopenharmony_ci * booleanArray, char, charArray, String, StringArray, {@link IRemoteObject}, IRemoteObjectArray, 25661847f8eSopenharmony_ci * {@link Sequenceable}, and SequenceableArray. 25761847f8eSopenharmony_ci * 25861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 25961847f8eSopenharmony_ci * @since 7 26061847f8eSopenharmony_ci * @deprecated since 9 26161847f8eSopenharmony_ci * @useinstead ohos.rpc.MessageSequence 26261847f8eSopenharmony_ci */ 26361847f8eSopenharmony_ci class MessageParcel { 26461847f8eSopenharmony_ci /** 26561847f8eSopenharmony_ci * Creates an empty {@link MessageParcel} object. 26661847f8eSopenharmony_ci * 26761847f8eSopenharmony_ci * @returns { MessageParcel } Return the object created. 26861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 26961847f8eSopenharmony_ci * @since 7 27061847f8eSopenharmony_ci * @deprecated since 9 27161847f8eSopenharmony_ci */ 27261847f8eSopenharmony_ci static create(): MessageParcel; 27361847f8eSopenharmony_ci 27461847f8eSopenharmony_ci /** 27561847f8eSopenharmony_ci * Reclaim the {@link MessageParcel} object. 27661847f8eSopenharmony_ci * 27761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 27861847f8eSopenharmony_ci * @since 7 27961847f8eSopenharmony_ci * @deprecated since 9 28061847f8eSopenharmony_ci */ 28161847f8eSopenharmony_ci reclaim(): void; 28261847f8eSopenharmony_ci 28361847f8eSopenharmony_ci /** 28461847f8eSopenharmony_ci * Serialize a remote object and writes it to the {@link MessageParcel} object. 28561847f8eSopenharmony_ci * 28661847f8eSopenharmony_ci * @param { IRemoteObject } object - Remote object to serialize. 28761847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if it is successful; return {@code false} otherwise. 28861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 28961847f8eSopenharmony_ci * @since 7 29061847f8eSopenharmony_ci * @deprecated since 9 29161847f8eSopenharmony_ci */ 29261847f8eSopenharmony_ci writeRemoteObject(object: IRemoteObject): boolean; 29361847f8eSopenharmony_ci 29461847f8eSopenharmony_ci /** 29561847f8eSopenharmony_ci * Reads a remote object from {@link MessageParcel} object. 29661847f8eSopenharmony_ci * 29761847f8eSopenharmony_ci * @returns { IRemoteObject } Return the remote object. 29861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 29961847f8eSopenharmony_ci * @since 7 30061847f8eSopenharmony_ci * @deprecated since 9 30161847f8eSopenharmony_ci */ 30261847f8eSopenharmony_ci readRemoteObject(): IRemoteObject; 30361847f8eSopenharmony_ci 30461847f8eSopenharmony_ci /** 30561847f8eSopenharmony_ci * Writes an interface token into the {@link MessageParcel} object. 30661847f8eSopenharmony_ci * 30761847f8eSopenharmony_ci * @param { string } token - Interface descriptor to write. 30861847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the interface token has been written into the {@link MessageParcel}; 30961847f8eSopenharmony_ci * return {@code false} otherwise. 31061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 31161847f8eSopenharmony_ci * @since 7 31261847f8eSopenharmony_ci * @deprecated since 9 31361847f8eSopenharmony_ci */ 31461847f8eSopenharmony_ci writeInterfaceToken(token: string): boolean; 31561847f8eSopenharmony_ci 31661847f8eSopenharmony_ci /** 31761847f8eSopenharmony_ci * Reads an interface token from the {@link MessageParcel} object. 31861847f8eSopenharmony_ci * 31961847f8eSopenharmony_ci * @returns { string } Return a string value. 32061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 32161847f8eSopenharmony_ci * @since 7 32261847f8eSopenharmony_ci * @deprecated since 9 32361847f8eSopenharmony_ci */ 32461847f8eSopenharmony_ci readInterfaceToken(): string; 32561847f8eSopenharmony_ci 32661847f8eSopenharmony_ci /** 32761847f8eSopenharmony_ci * Obtains the size of data (in bytes) contained in the {@link MessageParcel} object. 32861847f8eSopenharmony_ci * 32961847f8eSopenharmony_ci * @returns { number } Return the size of data contained in the {@link MessageParcel} object. 33061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 33161847f8eSopenharmony_ci * @since 7 33261847f8eSopenharmony_ci * @deprecated since 9 33361847f8eSopenharmony_ci */ 33461847f8eSopenharmony_ci getSize(): number; 33561847f8eSopenharmony_ci 33661847f8eSopenharmony_ci /** 33761847f8eSopenharmony_ci * Obtains the storage capacity (in bytes) of the {@link MessageParcel} object. 33861847f8eSopenharmony_ci * 33961847f8eSopenharmony_ci * @returns { number } Return the storage capacity of the {@link MessageParcel} object. 34061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 34161847f8eSopenharmony_ci * @since 7 34261847f8eSopenharmony_ci * @deprecated since 9 34361847f8eSopenharmony_ci */ 34461847f8eSopenharmony_ci getCapacity(): number; 34561847f8eSopenharmony_ci 34661847f8eSopenharmony_ci /** 34761847f8eSopenharmony_ci * Sets the size of data (in bytes) contained in the {@link MessageParcel} object. 34861847f8eSopenharmony_ci * <p>{@code false} is returned if the data size set in this method is greater 34961847f8eSopenharmony_ci * than the storage capacity of the {@link MessageParcel}. 35061847f8eSopenharmony_ci * 35161847f8eSopenharmony_ci * @param { number } size - Indicates the data size of the {@link MessageParcel} object. 35261847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the setting is successful; return {@code false} otherwise. 35361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 35461847f8eSopenharmony_ci * @since 7 35561847f8eSopenharmony_ci * @deprecated since 9 35661847f8eSopenharmony_ci */ 35761847f8eSopenharmony_ci setSize(size: number): boolean; 35861847f8eSopenharmony_ci 35961847f8eSopenharmony_ci /** 36061847f8eSopenharmony_ci * Sets the storage capacity (in bytes) of the {@link MessageParcel} object. 36161847f8eSopenharmony_ci * <p>{@code false} is returned if the capacity set in this method is less than 36261847f8eSopenharmony_ci * the size of data contained in the {@link MessageParcel}. 36361847f8eSopenharmony_ci * 36461847f8eSopenharmony_ci * @param { number } size - Indicates the storage capacity of the {@link MessageParcel} object. 36561847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the setting is successful; return {@code false} otherwise. 36661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 36761847f8eSopenharmony_ci * @since 7 36861847f8eSopenharmony_ci * @deprecated since 9 36961847f8eSopenharmony_ci */ 37061847f8eSopenharmony_ci setCapacity(size: number): boolean; 37161847f8eSopenharmony_ci 37261847f8eSopenharmony_ci /** 37361847f8eSopenharmony_ci * Obtains the writable data space (in bytes) in the {@link MessageParcel} object. 37461847f8eSopenharmony_ci * <p>Writable data space = Storage capacity of the {@link MessageParcel} – Size of data contained 37561847f8eSopenharmony_ci * in the {@link MessageParcel}. 37661847f8eSopenharmony_ci * 37761847f8eSopenharmony_ci * @returns { number } Return the writable data space of the {@link MessageParcel} object. 37861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 37961847f8eSopenharmony_ci * @since 7 38061847f8eSopenharmony_ci * @deprecated since 9 38161847f8eSopenharmony_ci */ 38261847f8eSopenharmony_ci getWritableBytes(): number; 38361847f8eSopenharmony_ci 38461847f8eSopenharmony_ci /** 38561847f8eSopenharmony_ci * Obtains the readable data space (in bytes) in the {@link MessageParcel} object. 38661847f8eSopenharmony_ci * <p>Readable data space = Size of data contained in the {@link MessageParcel} – Size of data that has been read. 38761847f8eSopenharmony_ci * 38861847f8eSopenharmony_ci * @returns { number } Return the readable data space of the {@link MessageParcel} object. 38961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 39061847f8eSopenharmony_ci * @since 7 39161847f8eSopenharmony_ci * @deprecated since 9 39261847f8eSopenharmony_ci */ 39361847f8eSopenharmony_ci getReadableBytes(): number; 39461847f8eSopenharmony_ci 39561847f8eSopenharmony_ci /** 39661847f8eSopenharmony_ci * Obtains the current read position in the {@link MessageParcel} object. 39761847f8eSopenharmony_ci * 39861847f8eSopenharmony_ci * @returns { number } Return the current read position in the {@link MessageParcel} object. 39961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 40061847f8eSopenharmony_ci * @since 7 40161847f8eSopenharmony_ci * @deprecated since 9 40261847f8eSopenharmony_ci */ 40361847f8eSopenharmony_ci getReadPosition(): number; 40461847f8eSopenharmony_ci 40561847f8eSopenharmony_ci /** 40661847f8eSopenharmony_ci * Obtains the current write position in the {@link MessageParcel} object. 40761847f8eSopenharmony_ci * 40861847f8eSopenharmony_ci * @returns { number } Return the current write position in the {@link MessageParcel} object. 40961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 41061847f8eSopenharmony_ci * @since 7 41161847f8eSopenharmony_ci * @deprecated since 9 41261847f8eSopenharmony_ci */ 41361847f8eSopenharmony_ci getWritePosition(): number; 41461847f8eSopenharmony_ci 41561847f8eSopenharmony_ci /** 41661847f8eSopenharmony_ci * Changes the current read position in the {@link MessageParcel} object. 41761847f8eSopenharmony_ci * <p>Generally, you are advised not to change the current read position. If you must 41861847f8eSopenharmony_ci * change it, change it to an accurate position. Otherwise, the read data may be incorrect. 41961847f8eSopenharmony_ci * 42061847f8eSopenharmony_ci * @param { number } pos - Indicates the target position to start data reading. 42161847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the read position is changed; return {@code false} otherwise. 42261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 42361847f8eSopenharmony_ci * @since 7 42461847f8eSopenharmony_ci * @deprecated since 9 42561847f8eSopenharmony_ci */ 42661847f8eSopenharmony_ci rewindRead(pos: number): boolean; 42761847f8eSopenharmony_ci 42861847f8eSopenharmony_ci /** 42961847f8eSopenharmony_ci * Changes the current write position in the {@link MessageParcel} object. 43061847f8eSopenharmony_ci * <p>Generally, you are advised not to change the current write position. If you must 43161847f8eSopenharmony_ci * change it, change it to an accurate position. Otherwise, the data to be read may be incorrect. 43261847f8eSopenharmony_ci * 43361847f8eSopenharmony_ci * @param { number } pos - Indicates the target position to start data writing. 43461847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the write position is changed; return {@code false} otherwise. 43561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 43661847f8eSopenharmony_ci * @since 7 43761847f8eSopenharmony_ci * @deprecated since 9 43861847f8eSopenharmony_ci */ 43961847f8eSopenharmony_ci rewindWrite(pos: number): boolean; 44061847f8eSopenharmony_ci 44161847f8eSopenharmony_ci /** 44261847f8eSopenharmony_ci * Writes information to this MessageParcel object indicating that no exception occurred. 44361847f8eSopenharmony_ci * <p>After handling requests, you should call this method before writing any data to reply {@link MessageParcel}. 44461847f8eSopenharmony_ci * 44561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 44661847f8eSopenharmony_ci * @since 8 44761847f8eSopenharmony_ci * @deprecated since 9 44861847f8eSopenharmony_ci */ 44961847f8eSopenharmony_ci writeNoException(): void; 45061847f8eSopenharmony_ci 45161847f8eSopenharmony_ci /** 45261847f8eSopenharmony_ci * Reads the exception information from this MessageParcel object. 45361847f8eSopenharmony_ci * <p>If exception was thrown in server side, it will be thrown here. 45461847f8eSopenharmony_ci * This method should be called before reading any data from reply {@link MessageParcel} 45561847f8eSopenharmony_ci * if {@link writeNoException} was invoked in server side. 45661847f8eSopenharmony_ci * 45761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 45861847f8eSopenharmony_ci * @since 8 45961847f8eSopenharmony_ci * @deprecated since 9 46061847f8eSopenharmony_ci */ 46161847f8eSopenharmony_ci readException(): void; 46261847f8eSopenharmony_ci 46361847f8eSopenharmony_ci /** 46461847f8eSopenharmony_ci * Writes a byte value into the {@link MessageParcel} object. 46561847f8eSopenharmony_ci * 46661847f8eSopenharmony_ci * @param { number } val - Indicates the byte value to write. 46761847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the value has been written into the {@link MessageParcel}; 46861847f8eSopenharmony_ci * return {@code false} otherwise. 46961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 47061847f8eSopenharmony_ci * @since 7 47161847f8eSopenharmony_ci * @deprecated since 9 47261847f8eSopenharmony_ci */ 47361847f8eSopenharmony_ci writeByte(val: number): boolean; 47461847f8eSopenharmony_ci 47561847f8eSopenharmony_ci /** 47661847f8eSopenharmony_ci * Writes a short integer value into the {@link MessageParcel} object. 47761847f8eSopenharmony_ci * 47861847f8eSopenharmony_ci * @param { number } val - Indicates the short integer value to write. 47961847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the value has been written into the {@link MessageParcel}; 48061847f8eSopenharmony_ci * return {@code false} otherwise. 48161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 48261847f8eSopenharmony_ci * @since 7 48361847f8eSopenharmony_ci * @deprecated since 9 48461847f8eSopenharmony_ci */ 48561847f8eSopenharmony_ci writeShort(val: number): boolean; 48661847f8eSopenharmony_ci 48761847f8eSopenharmony_ci /** 48861847f8eSopenharmony_ci * Writes an integer value into the {@link MessageParcel} object. 48961847f8eSopenharmony_ci * 49061847f8eSopenharmony_ci * @param { number } val - Indicates the integer value to write. 49161847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the value has been written into the {@link MessageParcel}; 49261847f8eSopenharmony_ci * return {@code false} otherwise. 49361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 49461847f8eSopenharmony_ci * @since 7 49561847f8eSopenharmony_ci * @deprecated since 9 49661847f8eSopenharmony_ci */ 49761847f8eSopenharmony_ci writeInt(val: number): boolean; 49861847f8eSopenharmony_ci 49961847f8eSopenharmony_ci /** 50061847f8eSopenharmony_ci * Writes a long integer value into the {@link MessageParcel} object. 50161847f8eSopenharmony_ci * 50261847f8eSopenharmony_ci * @param { number } val - Indicates the long integer value to write. 50361847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the value has been written into the {@link MessageParcel}; 50461847f8eSopenharmony_ci * return {@code false} otherwise. 50561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 50661847f8eSopenharmony_ci * @since 7 50761847f8eSopenharmony_ci * @deprecated since 9 50861847f8eSopenharmony_ci */ 50961847f8eSopenharmony_ci writeLong(val: number): boolean; 51061847f8eSopenharmony_ci 51161847f8eSopenharmony_ci /** 51261847f8eSopenharmony_ci * Writes a floating point value into the {@link MessageParcel} object. 51361847f8eSopenharmony_ci * 51461847f8eSopenharmony_ci * @param { number } val - Indicates the floating point value to write. 51561847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the value has been written into the {@link MessageParcel}; 51661847f8eSopenharmony_ci * return {@code false} otherwise. 51761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 51861847f8eSopenharmony_ci * @since 7 51961847f8eSopenharmony_ci * @deprecated since 9 52061847f8eSopenharmony_ci */ 52161847f8eSopenharmony_ci writeFloat(val: number): boolean; 52261847f8eSopenharmony_ci 52361847f8eSopenharmony_ci /** 52461847f8eSopenharmony_ci * Writes a double-precision floating point value into the {@link MessageParcel} object. 52561847f8eSopenharmony_ci * 52661847f8eSopenharmony_ci * @param { number } val - Indicates the double-precision floating point value to write. 52761847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the value has been written into the {@link MessageParcel}; 52861847f8eSopenharmony_ci * return {@code false} otherwise. 52961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 53061847f8eSopenharmony_ci * @since 7 53161847f8eSopenharmony_ci * @deprecated since 9 53261847f8eSopenharmony_ci */ 53361847f8eSopenharmony_ci writeDouble(val: number): boolean; 53461847f8eSopenharmony_ci 53561847f8eSopenharmony_ci /** 53661847f8eSopenharmony_ci * Writes a boolean value into the {@link MessageParcel} object. 53761847f8eSopenharmony_ci * 53861847f8eSopenharmony_ci * @param { boolean } val - Indicates the boolean value to write. 53961847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the value has been written into the {@link MessageParcel}; 54061847f8eSopenharmony_ci * return {@code false} otherwise. 54161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 54261847f8eSopenharmony_ci * @since 7 54361847f8eSopenharmony_ci * @deprecated since 9 54461847f8eSopenharmony_ci */ 54561847f8eSopenharmony_ci writeBoolean(val: boolean): boolean; 54661847f8eSopenharmony_ci 54761847f8eSopenharmony_ci /** 54861847f8eSopenharmony_ci * Writes a single character value into the {@link MessageParcel} object. 54961847f8eSopenharmony_ci * 55061847f8eSopenharmony_ci * @param { number } val - Indicates the single character value to write. 55161847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the value has been written into the {@link MessageParcel}; 55261847f8eSopenharmony_ci * return {@code false} otherwise. 55361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 55461847f8eSopenharmony_ci * @since 7 55561847f8eSopenharmony_ci * @deprecated since 9 55661847f8eSopenharmony_ci */ 55761847f8eSopenharmony_ci writeChar(val: number): boolean; 55861847f8eSopenharmony_ci 55961847f8eSopenharmony_ci /** 56061847f8eSopenharmony_ci * Writes a string value into the {@link MessageParcel} object. 56161847f8eSopenharmony_ci * 56261847f8eSopenharmony_ci * @param { string } val - Indicates the string value to write. 56361847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the value has been written into the {@link MessageParcel}; 56461847f8eSopenharmony_ci * return {@code false} otherwise. 56561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 56661847f8eSopenharmony_ci * @since 7 56761847f8eSopenharmony_ci * @deprecated since 9 56861847f8eSopenharmony_ci */ 56961847f8eSopenharmony_ci writeString(val: string): boolean; 57061847f8eSopenharmony_ci 57161847f8eSopenharmony_ci /** 57261847f8eSopenharmony_ci * Writes a {@link Sequenceable} object into the {@link MessageParcel} object. 57361847f8eSopenharmony_ci * 57461847f8eSopenharmony_ci * @param { Sequenceable } val - Indicates the {@link Sequenceable} object to write. 57561847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the {@link Sequenceable} object has been written into 57661847f8eSopenharmony_ci * the {@link MessageParcel}; return {@code false} otherwise. 57761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 57861847f8eSopenharmony_ci * @since 7 57961847f8eSopenharmony_ci * @deprecated since 9 58061847f8eSopenharmony_ci */ 58161847f8eSopenharmony_ci writeSequenceable(val: Sequenceable): boolean; 58261847f8eSopenharmony_ci 58361847f8eSopenharmony_ci /** 58461847f8eSopenharmony_ci * Writes a byte array into the {@link MessageParcel} object. 58561847f8eSopenharmony_ci * 58661847f8eSopenharmony_ci * @param { number[] } byteArray - Indicates the byte array to write. 58761847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the array has been written into the {@link MessageParcel}; 58861847f8eSopenharmony_ci * return {@code false} otherwise. 58961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 59061847f8eSopenharmony_ci * @since 7 59161847f8eSopenharmony_ci * @deprecated since 9 59261847f8eSopenharmony_ci */ 59361847f8eSopenharmony_ci writeByteArray(byteArray: number[]): boolean; 59461847f8eSopenharmony_ci 59561847f8eSopenharmony_ci /** 59661847f8eSopenharmony_ci * Writes a short integer array into the {@link MessageParcel} object. 59761847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 59861847f8eSopenharmony_ci * Otherwise,data may be truncated. 59961847f8eSopenharmony_ci * 60061847f8eSopenharmony_ci * @param { number[] } shortArray - Indicates the short integer array to write. 60161847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the array has been written into the {@link MessageParcel}; 60261847f8eSopenharmony_ci * return {@code false} otherwise. 60361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 60461847f8eSopenharmony_ci * @since 7 60561847f8eSopenharmony_ci * @deprecated since 9 60661847f8eSopenharmony_ci */ 60761847f8eSopenharmony_ci writeShortArray(shortArray: number[]): boolean; 60861847f8eSopenharmony_ci 60961847f8eSopenharmony_ci /** 61061847f8eSopenharmony_ci * Writes an integer array into the {@link MessageParcel} object. 61161847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 61261847f8eSopenharmony_ci * Otherwise,data may be truncated. 61361847f8eSopenharmony_ci * 61461847f8eSopenharmony_ci * @param { number[] } intArray - Indicates the integer array to write. 61561847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the array has been written into the {@link MessageParcel}; 61661847f8eSopenharmony_ci * return {@code false} otherwise. 61761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 61861847f8eSopenharmony_ci * @since 7 61961847f8eSopenharmony_ci * @deprecated since 9 62061847f8eSopenharmony_ci */ 62161847f8eSopenharmony_ci writeIntArray(intArray: number[]): boolean; 62261847f8eSopenharmony_ci 62361847f8eSopenharmony_ci /** 62461847f8eSopenharmony_ci * Writes a long integer array into the {@link MessageParcel} object. 62561847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 62661847f8eSopenharmony_ci * Otherwise,data may be truncated. 62761847f8eSopenharmony_ci * 62861847f8eSopenharmony_ci * @param { number[] } longArray - Indicates the long integer array to write. 62961847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the array has been written into the {@link MessageParcel}; 63061847f8eSopenharmony_ci * return {@code false} otherwise. 63161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 63261847f8eSopenharmony_ci * @since 7 63361847f8eSopenharmony_ci * @deprecated since 9 63461847f8eSopenharmony_ci */ 63561847f8eSopenharmony_ci writeLongArray(longArray: number[]): boolean; 63661847f8eSopenharmony_ci 63761847f8eSopenharmony_ci /** 63861847f8eSopenharmony_ci * Writes a floating point array into the {@link MessageParcel} object. 63961847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 64061847f8eSopenharmony_ci * Otherwise,data may be truncated. 64161847f8eSopenharmony_ci * 64261847f8eSopenharmony_ci * @param { number[] } floatArray - Indicates the floating point array to write. 64361847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the array has been written into the {@link MessageParcel}; 64461847f8eSopenharmony_ci * return {@code false} otherwise. 64561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 64661847f8eSopenharmony_ci * @since 7 64761847f8eSopenharmony_ci * @deprecated since 9 64861847f8eSopenharmony_ci */ 64961847f8eSopenharmony_ci writeFloatArray(floatArray: number[]): boolean; 65061847f8eSopenharmony_ci 65161847f8eSopenharmony_ci /** 65261847f8eSopenharmony_ci * Writes a double-precision floating point array into the {@link MessageParcel} object. 65361847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 65461847f8eSopenharmony_ci * Otherwise,data may be truncated. 65561847f8eSopenharmony_ci * 65661847f8eSopenharmony_ci * @param { number[] } doubleArray - Indicates the double-precision floating point array to write. 65761847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the array has been written into the {@link MessageParcel}; 65861847f8eSopenharmony_ci * return {@code false} otherwise. 65961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 66061847f8eSopenharmony_ci * @since 7 66161847f8eSopenharmony_ci * @deprecated since 9 66261847f8eSopenharmony_ci */ 66361847f8eSopenharmony_ci writeDoubleArray(doubleArray: number[]): boolean; 66461847f8eSopenharmony_ci 66561847f8eSopenharmony_ci /** 66661847f8eSopenharmony_ci * Writes a boolean array into the {@link MessageParcel} object. 66761847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 66861847f8eSopenharmony_ci * Otherwise,data may be truncated. 66961847f8eSopenharmony_ci * 67061847f8eSopenharmony_ci * @param { boolean[] } booleanArray - Indicates the boolean array to write. 67161847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the array has been written into the {@link MessageParcel}; 67261847f8eSopenharmony_ci * return {@code false} otherwise. 67361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 67461847f8eSopenharmony_ci * @since 7 67561847f8eSopenharmony_ci * @deprecated since 9 67661847f8eSopenharmony_ci */ 67761847f8eSopenharmony_ci writeBooleanArray(booleanArray: boolean[]): boolean; 67861847f8eSopenharmony_ci 67961847f8eSopenharmony_ci /** 68061847f8eSopenharmony_ci * Writes a single character array into the {@link MessageParcel} object. 68161847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 68261847f8eSopenharmony_ci * Otherwise,data may be truncated. 68361847f8eSopenharmony_ci * 68461847f8eSopenharmony_ci * @param { number[] } charArray - Indicates the single character array to write. 68561847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the array has been written into the {@link MessageParcel}; 68661847f8eSopenharmony_ci * return {@code false} otherwise. 68761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 68861847f8eSopenharmony_ci * @since 7 68961847f8eSopenharmony_ci * @deprecated since 9 69061847f8eSopenharmony_ci */ 69161847f8eSopenharmony_ci writeCharArray(charArray: number[]): boolean; 69261847f8eSopenharmony_ci 69361847f8eSopenharmony_ci /** 69461847f8eSopenharmony_ci * Writes a string array into the {@link MessageParcel} object. 69561847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 69661847f8eSopenharmony_ci * Otherwise,data may be truncated. 69761847f8eSopenharmony_ci * 69861847f8eSopenharmony_ci * @param { string[] } stringArray - Indicates the string array to write. 69961847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the array has been written into the {@link MessageParcel}; 70061847f8eSopenharmony_ci * return {@code false} otherwise. 70161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 70261847f8eSopenharmony_ci * @since 7 70361847f8eSopenharmony_ci * @deprecated since 9 70461847f8eSopenharmony_ci */ 70561847f8eSopenharmony_ci writeStringArray(stringArray: string[]): boolean; 70661847f8eSopenharmony_ci 70761847f8eSopenharmony_ci /** 70861847f8eSopenharmony_ci * Writes a {@link Sequenceable} object array into the {@link MessageParcel} object. 70961847f8eSopenharmony_ci * 71061847f8eSopenharmony_ci * @param { Sequenceable[] } sequenceableArray - Indicates the {@link Sequenceable} object array to write. 71161847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the array has been written into the {@link MessageParcel}; 71261847f8eSopenharmony_ci * return {@code false} otherwise. 71361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 71461847f8eSopenharmony_ci * @since 7 71561847f8eSopenharmony_ci * @deprecated since 9 71661847f8eSopenharmony_ci */ 71761847f8eSopenharmony_ci writeSequenceableArray(sequenceableArray: Sequenceable[]): boolean; 71861847f8eSopenharmony_ci 71961847f8eSopenharmony_ci /** 72061847f8eSopenharmony_ci * Writes an array of {@link IRemoteObject} objects to this {@link MessageParcel} object. 72161847f8eSopenharmony_ci * 72261847f8eSopenharmony_ci * @param { IRemoteObject[] } objectArray - Array of {@link IRemoteObject} objects to write. 72361847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the {@link IRemoteObject} array is successfully written 72461847f8eSopenharmony_ci * to the {@link MessageParcel}; 72561847f8eSopenharmony_ci * return {@code false} if the {@link IRemoteObject} array is null or fails to be written 72661847f8eSopenharmony_ci * to the {@link MessageParcel}. 72761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 72861847f8eSopenharmony_ci * @since 8 72961847f8eSopenharmony_ci * @deprecated since 9 73061847f8eSopenharmony_ci */ 73161847f8eSopenharmony_ci writeRemoteObjectArray(objectArray: IRemoteObject[]): boolean; 73261847f8eSopenharmony_ci 73361847f8eSopenharmony_ci /** 73461847f8eSopenharmony_ci * Reads a byte value from the {@link MessageParcel} object. 73561847f8eSopenharmony_ci * 73661847f8eSopenharmony_ci * @returns { number } Return a byte value. 73761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 73861847f8eSopenharmony_ci * @since 7 73961847f8eSopenharmony_ci * @deprecated since 9 74061847f8eSopenharmony_ci */ 74161847f8eSopenharmony_ci readByte(): number; 74261847f8eSopenharmony_ci 74361847f8eSopenharmony_ci /** 74461847f8eSopenharmony_ci * Reads a short integer value from the {@link MessageParcel} object. 74561847f8eSopenharmony_ci * 74661847f8eSopenharmony_ci * @returns { number } Return a short integer value. 74761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 74861847f8eSopenharmony_ci * @since 7 74961847f8eSopenharmony_ci * @deprecated since 9 75061847f8eSopenharmony_ci */ 75161847f8eSopenharmony_ci readShort(): number; 75261847f8eSopenharmony_ci 75361847f8eSopenharmony_ci /** 75461847f8eSopenharmony_ci * Reads an integer value from the {@link MessageParcel} object. 75561847f8eSopenharmony_ci * 75661847f8eSopenharmony_ci * @returns { number } Return an integer value. 75761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 75861847f8eSopenharmony_ci * @since 7 75961847f8eSopenharmony_ci * @deprecated since 9 76061847f8eSopenharmony_ci */ 76161847f8eSopenharmony_ci readInt(): number; 76261847f8eSopenharmony_ci 76361847f8eSopenharmony_ci /** 76461847f8eSopenharmony_ci * Reads a long integer value from the {@link MessageParcel} object. 76561847f8eSopenharmony_ci * 76661847f8eSopenharmony_ci * @returns { number } Return a long integer value. 76761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 76861847f8eSopenharmony_ci * @since 7 76961847f8eSopenharmony_ci * @deprecated since 9 77061847f8eSopenharmony_ci */ 77161847f8eSopenharmony_ci readLong(): number; 77261847f8eSopenharmony_ci 77361847f8eSopenharmony_ci /** 77461847f8eSopenharmony_ci * Reads a floating point value from the {@link MessageParcel} object. 77561847f8eSopenharmony_ci * 77661847f8eSopenharmony_ci * @returns { number } Return a floating point value. 77761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 77861847f8eSopenharmony_ci * @since 7 77961847f8eSopenharmony_ci * @deprecated since 9 78061847f8eSopenharmony_ci */ 78161847f8eSopenharmony_ci readFloat(): number; 78261847f8eSopenharmony_ci 78361847f8eSopenharmony_ci /** 78461847f8eSopenharmony_ci * Reads a double-precision floating point value from the {@link MessageParcel} object. 78561847f8eSopenharmony_ci * 78661847f8eSopenharmony_ci * @returns { number } Return a double-precision floating point value. 78761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 78861847f8eSopenharmony_ci * @since 7 78961847f8eSopenharmony_ci * @deprecated since 9 79061847f8eSopenharmony_ci */ 79161847f8eSopenharmony_ci readDouble(): number; 79261847f8eSopenharmony_ci 79361847f8eSopenharmony_ci /** 79461847f8eSopenharmony_ci * Reads a boolean value from the {@link MessageParcel} object. 79561847f8eSopenharmony_ci * 79661847f8eSopenharmony_ci * @returns { boolean } Return a boolean value. 79761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 79861847f8eSopenharmony_ci * @since 7 79961847f8eSopenharmony_ci * @deprecated since 9 80061847f8eSopenharmony_ci */ 80161847f8eSopenharmony_ci readBoolean(): boolean; 80261847f8eSopenharmony_ci 80361847f8eSopenharmony_ci /** 80461847f8eSopenharmony_ci * Reads a single character value from the {@link MessageParcel} object. 80561847f8eSopenharmony_ci * 80661847f8eSopenharmony_ci * @returns { number } Return a single character value. 80761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 80861847f8eSopenharmony_ci * @since 7 80961847f8eSopenharmony_ci * @deprecated since 9 81061847f8eSopenharmony_ci */ 81161847f8eSopenharmony_ci readChar(): number; 81261847f8eSopenharmony_ci 81361847f8eSopenharmony_ci /** 81461847f8eSopenharmony_ci * Reads a string value from the {@link MessageParcel} object. 81561847f8eSopenharmony_ci * 81661847f8eSopenharmony_ci * @returns { string } Return a string value. 81761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 81861847f8eSopenharmony_ci * @since 7 81961847f8eSopenharmony_ci * @deprecated since 9 82061847f8eSopenharmony_ci */ 82161847f8eSopenharmony_ci readString(): string; 82261847f8eSopenharmony_ci 82361847f8eSopenharmony_ci /** 82461847f8eSopenharmony_ci * Reads a {@link Sequenceable} object from the {@link MessageParcel} instance. 82561847f8eSopenharmony_ci * 82661847f8eSopenharmony_ci * @param { Sequenceable } dataIn - Indicates the {@link Sequenceable} object that needs to perform 82761847f8eSopenharmony_ci * the {@code unmarshalling} operation using the {@link MessageParcel}. 82861847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the unmarshalling is successful; return {@code false} otherwise. 82961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 83061847f8eSopenharmony_ci * @since 7 83161847f8eSopenharmony_ci * @deprecated since 9 83261847f8eSopenharmony_ci */ 83361847f8eSopenharmony_ci readSequenceable(dataIn: Sequenceable): boolean; 83461847f8eSopenharmony_ci 83561847f8eSopenharmony_ci /** 83661847f8eSopenharmony_ci * Writes a byte array into the {@link MessageParcel} object. 83761847f8eSopenharmony_ci * 83861847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the byte array read from MessageParcel. 83961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 84061847f8eSopenharmony_ci * @since 7 84161847f8eSopenharmony_ci * @deprecated since 9 84261847f8eSopenharmony_ci */ 84361847f8eSopenharmony_ci readByteArray(dataIn: number[]): void; 84461847f8eSopenharmony_ci 84561847f8eSopenharmony_ci /** 84661847f8eSopenharmony_ci * Reads a byte array from the {@link MessageParcel} object. 84761847f8eSopenharmony_ci * 84861847f8eSopenharmony_ci * @returns { number[] } Return a byte array. 84961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 85061847f8eSopenharmony_ci * @since 7 85161847f8eSopenharmony_ci * @deprecated since 9 85261847f8eSopenharmony_ci */ 85361847f8eSopenharmony_ci readByteArray(): number[]; 85461847f8eSopenharmony_ci 85561847f8eSopenharmony_ci /** 85661847f8eSopenharmony_ci * Reads a short integer array from the {@link MessageParcel} object. 85761847f8eSopenharmony_ci * 85861847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the short integer array read from MessageParcel. 85961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 86061847f8eSopenharmony_ci * @since 7 86161847f8eSopenharmony_ci * @deprecated since 9 86261847f8eSopenharmony_ci */ 86361847f8eSopenharmony_ci readShortArray(dataIn: number[]): void; 86461847f8eSopenharmony_ci 86561847f8eSopenharmony_ci /** 86661847f8eSopenharmony_ci * Reads a short integer array from the {@link MessageParcel} object. 86761847f8eSopenharmony_ci * 86861847f8eSopenharmony_ci * @returns { number[] } Return a short integer array. 86961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 87061847f8eSopenharmony_ci * @since 7 87161847f8eSopenharmony_ci * @deprecated since 9 87261847f8eSopenharmony_ci */ 87361847f8eSopenharmony_ci readShortArray(): number[]; 87461847f8eSopenharmony_ci 87561847f8eSopenharmony_ci /** 87661847f8eSopenharmony_ci * Reads an integer array from the {@link MessageParcel} object. 87761847f8eSopenharmony_ci * 87861847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the integer array to read. 87961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 88061847f8eSopenharmony_ci * @since 7 88161847f8eSopenharmony_ci * @deprecated since 9 88261847f8eSopenharmony_ci */ 88361847f8eSopenharmony_ci readIntArray(dataIn: number[]): void; 88461847f8eSopenharmony_ci 88561847f8eSopenharmony_ci /** 88661847f8eSopenharmony_ci * Reads an integer array from the {@link MessageParcel} object. 88761847f8eSopenharmony_ci * 88861847f8eSopenharmony_ci * @returns { number[] } Return an integer array. 88961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 89061847f8eSopenharmony_ci * @since 7 89161847f8eSopenharmony_ci * @deprecated since 9 89261847f8eSopenharmony_ci */ 89361847f8eSopenharmony_ci readIntArray(): number[]; 89461847f8eSopenharmony_ci 89561847f8eSopenharmony_ci /** 89661847f8eSopenharmony_ci * Reads a long integer array from the {@link MessageParcel} object. 89761847f8eSopenharmony_ci * 89861847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the long integer array to read. 89961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 90061847f8eSopenharmony_ci * @since 7 90161847f8eSopenharmony_ci * @deprecated since 9 90261847f8eSopenharmony_ci */ 90361847f8eSopenharmony_ci readLongArray(dataIn: number[]): void; 90461847f8eSopenharmony_ci 90561847f8eSopenharmony_ci /** 90661847f8eSopenharmony_ci * Reads a long integer array from the {@link MessageParcel} object. 90761847f8eSopenharmony_ci * 90861847f8eSopenharmony_ci * @returns { number[] } Return a long integer array. 90961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 91061847f8eSopenharmony_ci * @since 7 91161847f8eSopenharmony_ci * @deprecated since 9 91261847f8eSopenharmony_ci */ 91361847f8eSopenharmony_ci readLongArray(): number[]; 91461847f8eSopenharmony_ci 91561847f8eSopenharmony_ci /** 91661847f8eSopenharmony_ci * Reads a floating point array from the {@link MessageParcel} object. 91761847f8eSopenharmony_ci * 91861847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the floating point array to read. 91961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 92061847f8eSopenharmony_ci * @since 7 92161847f8eSopenharmony_ci * @deprecated since 9 92261847f8eSopenharmony_ci */ 92361847f8eSopenharmony_ci readFloatArray(dataIn: number[]): void; 92461847f8eSopenharmony_ci 92561847f8eSopenharmony_ci /** 92661847f8eSopenharmony_ci * Reads a floating point array from the {@link MessageParcel} object. 92761847f8eSopenharmony_ci * 92861847f8eSopenharmony_ci * @returns { number[] } Return a floating point array. 92961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 93061847f8eSopenharmony_ci * @since 7 93161847f8eSopenharmony_ci * @deprecated since 9 93261847f8eSopenharmony_ci */ 93361847f8eSopenharmony_ci readFloatArray(): number[]; 93461847f8eSopenharmony_ci 93561847f8eSopenharmony_ci /** 93661847f8eSopenharmony_ci * Reads a double-precision floating point array from the {@link MessageParcel} object. 93761847f8eSopenharmony_ci * 93861847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the double-precision floating point array to read. 93961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 94061847f8eSopenharmony_ci * @since 7 94161847f8eSopenharmony_ci * @deprecated since 9 94261847f8eSopenharmony_ci */ 94361847f8eSopenharmony_ci readDoubleArray(dataIn: number[]): void; 94461847f8eSopenharmony_ci 94561847f8eSopenharmony_ci /** 94661847f8eSopenharmony_ci * Reads a double-precision floating point array from the {@link MessageParcel} object. 94761847f8eSopenharmony_ci * 94861847f8eSopenharmony_ci * @returns { number[] } Return a double-precision floating point array. 94961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 95061847f8eSopenharmony_ci * @since 7 95161847f8eSopenharmony_ci * @deprecated since 9 95261847f8eSopenharmony_ci */ 95361847f8eSopenharmony_ci readDoubleArray(): number[]; 95461847f8eSopenharmony_ci 95561847f8eSopenharmony_ci /** 95661847f8eSopenharmony_ci * Reads a boolean array from the {@link MessageParcel} object. 95761847f8eSopenharmony_ci * 95861847f8eSopenharmony_ci * @param { boolean[] } dataIn - Indicates the boolean array to read. 95961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 96061847f8eSopenharmony_ci * @since 7 96161847f8eSopenharmony_ci * @deprecated since 9 96261847f8eSopenharmony_ci */ 96361847f8eSopenharmony_ci readBooleanArray(dataIn: boolean[]): void; 96461847f8eSopenharmony_ci 96561847f8eSopenharmony_ci /** 96661847f8eSopenharmony_ci * Reads a boolean array from the {@link MessageParcel} object. 96761847f8eSopenharmony_ci * 96861847f8eSopenharmony_ci * @returns { boolean[] } Return a boolean array. 96961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 97061847f8eSopenharmony_ci * @since 7 97161847f8eSopenharmony_ci * @deprecated since 9 97261847f8eSopenharmony_ci */ 97361847f8eSopenharmony_ci readBooleanArray(): boolean[]; 97461847f8eSopenharmony_ci 97561847f8eSopenharmony_ci /** 97661847f8eSopenharmony_ci * Reads a single character array from the {@link MessageParcel} object. 97761847f8eSopenharmony_ci * 97861847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the single character array to read. 97961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 98061847f8eSopenharmony_ci * @since 7 98161847f8eSopenharmony_ci * @deprecated since 9 98261847f8eSopenharmony_ci */ 98361847f8eSopenharmony_ci readCharArray(dataIn: number[]): void; 98461847f8eSopenharmony_ci 98561847f8eSopenharmony_ci /** 98661847f8eSopenharmony_ci * Reads a single character array from the {@link MessageParcel} object. 98761847f8eSopenharmony_ci * 98861847f8eSopenharmony_ci * @returns { number[] } Return a single character array. 98961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 99061847f8eSopenharmony_ci * @since 7 99161847f8eSopenharmony_ci * @deprecated since 9 99261847f8eSopenharmony_ci */ 99361847f8eSopenharmony_ci readCharArray(): number[]; 99461847f8eSopenharmony_ci 99561847f8eSopenharmony_ci /** 99661847f8eSopenharmony_ci * Reads a string array from the {@link MessageParcel} object. 99761847f8eSopenharmony_ci * 99861847f8eSopenharmony_ci * @param { string[] } dataIn - Indicates the string array to read. 99961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 100061847f8eSopenharmony_ci * @since 7 100161847f8eSopenharmony_ci * @deprecated since 9 100261847f8eSopenharmony_ci */ 100361847f8eSopenharmony_ci readStringArray(dataIn: string[]): void; 100461847f8eSopenharmony_ci 100561847f8eSopenharmony_ci /** 100661847f8eSopenharmony_ci * Reads a string array from the {@link MessageParcel} object. 100761847f8eSopenharmony_ci * 100861847f8eSopenharmony_ci * @returns { string[] } Return a string array. 100961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 101061847f8eSopenharmony_ci * @since 7 101161847f8eSopenharmony_ci * @deprecated since 9 101261847f8eSopenharmony_ci */ 101361847f8eSopenharmony_ci readStringArray(): string[]; 101461847f8eSopenharmony_ci 101561847f8eSopenharmony_ci /** 101661847f8eSopenharmony_ci * Reads the specified {@link Sequenceable} array from this {@link MessageParcel} object. 101761847f8eSopenharmony_ci * 101861847f8eSopenharmony_ci * @param { Sequenceable[] } sequenceableArray - Sequenceable array to read. 101961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 102061847f8eSopenharmony_ci * @since 8 102161847f8eSopenharmony_ci * @deprecated since 9 102261847f8eSopenharmony_ci */ 102361847f8eSopenharmony_ci readSequenceableArray(sequenceableArray: Sequenceable[]): void; 102461847f8eSopenharmony_ci 102561847f8eSopenharmony_ci /** 102661847f8eSopenharmony_ci * Reads the specified {@link IRemoteObject} array from this {@link MessageParcel} object. 102761847f8eSopenharmony_ci * 102861847f8eSopenharmony_ci * @param { IRemoteObject[] } objects - Reads data from this {@link MessageParcel} object to the specified 102961847f8eSopenharmony_ci * {@link IRemoteObject} array. 103061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 103161847f8eSopenharmony_ci * @since 8 103261847f8eSopenharmony_ci * @deprecated since 9 103361847f8eSopenharmony_ci */ 103461847f8eSopenharmony_ci readRemoteObjectArray(objects: IRemoteObject[]): void; 103561847f8eSopenharmony_ci 103661847f8eSopenharmony_ci /** 103761847f8eSopenharmony_ci * Reads {@link IRemoteObject} objects from this {@link MessageParcel} object. 103861847f8eSopenharmony_ci * 103961847f8eSopenharmony_ci * @returns { IRemoteObject[] } An array of {@link IRemoteObject} objects obtained. 104061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 104161847f8eSopenharmony_ci * @since 8 104261847f8eSopenharmony_ci * @deprecated since 9 104361847f8eSopenharmony_ci */ 104461847f8eSopenharmony_ci readRemoteObjectArray(): IRemoteObject[]; 104561847f8eSopenharmony_ci 104661847f8eSopenharmony_ci /** 104761847f8eSopenharmony_ci * Closes the specified file descriptor. 104861847f8eSopenharmony_ci * 104961847f8eSopenharmony_ci * @param { number } fd - File descriptor to be closed. 105061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 105161847f8eSopenharmony_ci * @since 8 105261847f8eSopenharmony_ci * @deprecated since 9 105361847f8eSopenharmony_ci */ 105461847f8eSopenharmony_ci static closeFileDescriptor(fd: number): void; 105561847f8eSopenharmony_ci 105661847f8eSopenharmony_ci /** 105761847f8eSopenharmony_ci * Duplicates the specified file descriptor. 105861847f8eSopenharmony_ci * 105961847f8eSopenharmony_ci * @param { number } fd - File descriptor to be duplicated. 106061847f8eSopenharmony_ci * @returns { number } Return a duplicated file descriptor. 106161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 106261847f8eSopenharmony_ci * @since 8 106361847f8eSopenharmony_ci * @deprecated since 9 106461847f8eSopenharmony_ci */ 106561847f8eSopenharmony_ci static dupFileDescriptor(fd: number): number; 106661847f8eSopenharmony_ci 106761847f8eSopenharmony_ci /** 106861847f8eSopenharmony_ci * Checks whether this {@link MessageParcel} object contains a file descriptor. 106961847f8eSopenharmony_ci * 107061847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the {@link MessageParcel} object contains a file descriptor; 107161847f8eSopenharmony_ci * return {@code false} otherwise. 107261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 107361847f8eSopenharmony_ci * @since 8 107461847f8eSopenharmony_ci * @deprecated since 9 107561847f8eSopenharmony_ci */ 107661847f8eSopenharmony_ci containFileDescriptors(): boolean; 107761847f8eSopenharmony_ci 107861847f8eSopenharmony_ci /** 107961847f8eSopenharmony_ci * Writes a file descriptor to this {@link MessageParcel} object. 108061847f8eSopenharmony_ci * 108161847f8eSopenharmony_ci * @param { number } fd - File descriptor to wrote. 108261847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the operation is successful; return {@code false} otherwise. 108361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 108461847f8eSopenharmony_ci * @since 8 108561847f8eSopenharmony_ci * @deprecated since 9 108661847f8eSopenharmony_ci */ 108761847f8eSopenharmony_ci writeFileDescriptor(fd: number): boolean; 108861847f8eSopenharmony_ci 108961847f8eSopenharmony_ci /** 109061847f8eSopenharmony_ci * Reads a file descriptor from this {@link MessageParcel} object. 109161847f8eSopenharmony_ci * 109261847f8eSopenharmony_ci * @returns { number } Return a file descriptor obtained. 109361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 109461847f8eSopenharmony_ci * @since 8 109561847f8eSopenharmony_ci * @deprecated since 9 109661847f8eSopenharmony_ci */ 109761847f8eSopenharmony_ci readFileDescriptor(): number; 109861847f8eSopenharmony_ci 109961847f8eSopenharmony_ci /** 110061847f8eSopenharmony_ci * Writes an anonymous shared memory object to this {@link MessageParcel} object. 110161847f8eSopenharmony_ci * 110261847f8eSopenharmony_ci * @param { Ashmem } ashmem - Anonymous shared memory object to wrote. 110361847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the operation is successful; return {@code false} otherwise. 110461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 110561847f8eSopenharmony_ci * @since 8 110661847f8eSopenharmony_ci * @deprecated since 9 110761847f8eSopenharmony_ci */ 110861847f8eSopenharmony_ci writeAshmem(ashmem: Ashmem): boolean; 110961847f8eSopenharmony_ci 111061847f8eSopenharmony_ci /** 111161847f8eSopenharmony_ci * Reads the anonymous shared memory object from this {@link MessageParcel} object. 111261847f8eSopenharmony_ci * 111361847f8eSopenharmony_ci * @returns { Ashmem } Anonymous share object obtained. 111461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 111561847f8eSopenharmony_ci * @since 8 111661847f8eSopenharmony_ci * @deprecated since 9 111761847f8eSopenharmony_ci */ 111861847f8eSopenharmony_ci readAshmem(): Ashmem; 111961847f8eSopenharmony_ci 112061847f8eSopenharmony_ci /** 112161847f8eSopenharmony_ci * Obtains the maximum amount of raw data that can be sent in a time. 112261847f8eSopenharmony_ci * 112361847f8eSopenharmony_ci * @returns { number } 128 MB. 112461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 112561847f8eSopenharmony_ci * @since 8 112661847f8eSopenharmony_ci * @deprecated since 9 112761847f8eSopenharmony_ci */ 112861847f8eSopenharmony_ci getRawDataCapacity(): number; 112961847f8eSopenharmony_ci 113061847f8eSopenharmony_ci /** 113161847f8eSopenharmony_ci * Writes raw data to this {@link MessageParcel} object. 113261847f8eSopenharmony_ci * 113361847f8eSopenharmony_ci * @param { number[] } rawData - Raw data to wrote. 113461847f8eSopenharmony_ci * @param { number } size - Size of the raw data, in bytes. 113561847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the operation is successful; return {@code false} otherwise. 113661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 113761847f8eSopenharmony_ci * @since 8 113861847f8eSopenharmony_ci * @deprecated since 9 113961847f8eSopenharmony_ci */ 114061847f8eSopenharmony_ci writeRawData(rawData: number[], size: number): boolean; 114161847f8eSopenharmony_ci 114261847f8eSopenharmony_ci /** 114361847f8eSopenharmony_ci * Reads raw data from this {@link MessageParcel} object. 114461847f8eSopenharmony_ci * 114561847f8eSopenharmony_ci * @param { number } size - Size of the raw data to read. 114661847f8eSopenharmony_ci * @returns { number[] } Return the raw data obtained, in bytes. 114761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 114861847f8eSopenharmony_ci * @since 8 114961847f8eSopenharmony_ci * @deprecated since 9 115061847f8eSopenharmony_ci */ 115161847f8eSopenharmony_ci readRawData(size: number): number[]; 115261847f8eSopenharmony_ci } 115361847f8eSopenharmony_ci 115461847f8eSopenharmony_ci /** 115561847f8eSopenharmony_ci * A data object used for remote procedure call (RPC). 115661847f8eSopenharmony_ci * <p> 115761847f8eSopenharmony_ci * During RPC, the sender can use the write methods provided by {@link MessageSequence} to 115861847f8eSopenharmony_ci * write the to-be-sent data into a {@link MessageSequence} object in a specific format, and the receiver can use the 115961847f8eSopenharmony_ci * read methods provided by {@link MessageSequence} to read data of the specific format from 116061847f8eSopenharmony_ci * the {@link MessageSequence} object. 116161847f8eSopenharmony_ci * <p> 116261847f8eSopenharmony_ci * <p> 116361847f8eSopenharmony_ci * The default capacity of a {@link MessageSequence} instance is 200KB. If you want more or less, 116461847f8eSopenharmony_ci * use {@link #setCapacity(int)} to change it. 116561847f8eSopenharmony_ci * </p> 116661847f8eSopenharmony_ci * <b>Note</b>: Only data of the following data types can be written into or read from a {@link MessageSequence}: 116761847f8eSopenharmony_ci * byte, byteArray, short, shortArray, int, intArray, long, longArray, float, floatArray, double, doubleArray, 116861847f8eSopenharmony_ci * boolean, booleanArray, char, charArray, String, StringArray, {@link IRemoteObject}, IRemoteObjectArray, 116961847f8eSopenharmony_ci * {@link Parcelable}, and ParcelableArray. 117061847f8eSopenharmony_ci * 117161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 117261847f8eSopenharmony_ci * @since 9 117361847f8eSopenharmony_ci */ 117461847f8eSopenharmony_ci class MessageSequence { 117561847f8eSopenharmony_ci /** 117661847f8eSopenharmony_ci * Creates an empty {@link MessageSequence} object. 117761847f8eSopenharmony_ci * 117861847f8eSopenharmony_ci * @returns { MessageSequence } Return the object created. 117961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 118061847f8eSopenharmony_ci * @since 9 118161847f8eSopenharmony_ci */ 118261847f8eSopenharmony_ci static create(): MessageSequence; 118361847f8eSopenharmony_ci 118461847f8eSopenharmony_ci /** 118561847f8eSopenharmony_ci * Reclaim the {@link MessageSequence} object. 118661847f8eSopenharmony_ci * 118761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 118861847f8eSopenharmony_ci * @since 9 118961847f8eSopenharmony_ci */ 119061847f8eSopenharmony_ci reclaim(): void; 119161847f8eSopenharmony_ci 119261847f8eSopenharmony_ci /** 119361847f8eSopenharmony_ci * Serialize a remote object and writes it to the {@link MessageSequence} object. 119461847f8eSopenharmony_ci * 119561847f8eSopenharmony_ci * @param { IRemoteObject } object - Remote object to serialize. 119661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 119761847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 119861847f8eSopenharmony_ci * 2.The parameter type does not match. 119961847f8eSopenharmony_ci * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. 120061847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 120161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 120261847f8eSopenharmony_ci * @since 9 120361847f8eSopenharmony_ci */ 120461847f8eSopenharmony_ci writeRemoteObject(object: IRemoteObject): void; 120561847f8eSopenharmony_ci 120661847f8eSopenharmony_ci /** 120761847f8eSopenharmony_ci * Reads a remote object from {@link MessageSequence} object. 120861847f8eSopenharmony_ci * 120961847f8eSopenharmony_ci * @returns { IRemoteObject } Return the remote object. 121061847f8eSopenharmony_ci * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. 121161847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 121261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 121361847f8eSopenharmony_ci * @since 9 121461847f8eSopenharmony_ci */ 121561847f8eSopenharmony_ci readRemoteObject(): IRemoteObject; 121661847f8eSopenharmony_ci 121761847f8eSopenharmony_ci /** 121861847f8eSopenharmony_ci * Writes an interface token into the {@link MessageSequence} object. 121961847f8eSopenharmony_ci * 122061847f8eSopenharmony_ci * @param { string } token - Interface descriptor to write. 122161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 122261847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 122361847f8eSopenharmony_ci * 2.The parameter type does not match; 122461847f8eSopenharmony_ci * 3.The string length exceeds 40960 bytes; 122561847f8eSopenharmony_ci * 4.The number of bytes copied to the buffer is different from the length of the obtained string. 122661847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 122761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 122861847f8eSopenharmony_ci * @since 9 122961847f8eSopenharmony_ci */ 123061847f8eSopenharmony_ci writeInterfaceToken(token: string): void; 123161847f8eSopenharmony_ci 123261847f8eSopenharmony_ci /** 123361847f8eSopenharmony_ci * Reads an interface token from the {@link MessageSequence} object. 123461847f8eSopenharmony_ci * 123561847f8eSopenharmony_ci * @returns { string } Return a string value. 123661847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 123761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 123861847f8eSopenharmony_ci * @since 9 123961847f8eSopenharmony_ci */ 124061847f8eSopenharmony_ci readInterfaceToken(): string; 124161847f8eSopenharmony_ci 124261847f8eSopenharmony_ci /** 124361847f8eSopenharmony_ci * Obtains the size of data (in bytes) contained in the {@link MessageSequence} object. 124461847f8eSopenharmony_ci * 124561847f8eSopenharmony_ci * @returns { number } Return the size of data contained in the {@link MessageSequence} object. 124661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 124761847f8eSopenharmony_ci * @since 9 124861847f8eSopenharmony_ci */ 124961847f8eSopenharmony_ci getSize(): number; 125061847f8eSopenharmony_ci 125161847f8eSopenharmony_ci /** 125261847f8eSopenharmony_ci * Obtains the storage capacity (in bytes) of the {@link MessageSequence} object. 125361847f8eSopenharmony_ci * 125461847f8eSopenharmony_ci * @returns { number } Return the storage capacity of the {@link MessageSequence} object. 125561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 125661847f8eSopenharmony_ci * @since 9 125761847f8eSopenharmony_ci */ 125861847f8eSopenharmony_ci getCapacity(): number; 125961847f8eSopenharmony_ci 126061847f8eSopenharmony_ci /** 126161847f8eSopenharmony_ci * Sets the size of data (in bytes) contained in the {@link MessageSequence} object. 126261847f8eSopenharmony_ci * <p>{@code false} is returned if the data size set in this method is greater 126361847f8eSopenharmony_ci * than the storage capacity of the {@link MessageSequence}. 126461847f8eSopenharmony_ci * 126561847f8eSopenharmony_ci * @param { number } size - Indicates the data size of the {@link MessageSequence} object. 126661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 126761847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 126861847f8eSopenharmony_ci * 2.The parameter type does not match. 126961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 127061847f8eSopenharmony_ci * @since 9 127161847f8eSopenharmony_ci */ 127261847f8eSopenharmony_ci setSize(size: number): void; 127361847f8eSopenharmony_ci 127461847f8eSopenharmony_ci /** 127561847f8eSopenharmony_ci * Sets the storage capacity (in bytes) of the {@link MessageSequence} object. 127661847f8eSopenharmony_ci * <p>{@code false} is returned if the capacity set in this method is less than 127761847f8eSopenharmony_ci * the size of data contained in the {@link MessageSequence}. 127861847f8eSopenharmony_ci * 127961847f8eSopenharmony_ci * @param { number } size - Indicates the storage capacity of the {@link MessageSequence} object. 128061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 128161847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 128261847f8eSopenharmony_ci * 2.The parameter type does not match. 128361847f8eSopenharmony_ci * @throws { BusinessError } 1900011 - Memory allocation failed. 128461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 128561847f8eSopenharmony_ci * @since 9 128661847f8eSopenharmony_ci */ 128761847f8eSopenharmony_ci setCapacity(size: number): void; 128861847f8eSopenharmony_ci 128961847f8eSopenharmony_ci /** 129061847f8eSopenharmony_ci * Obtains the writable data space (in bytes) in the {@link MessageSequence} object. 129161847f8eSopenharmony_ci * <p>Writable data space = Storage capacity of the {@link MessageSequence} – Size of data contained in 129261847f8eSopenharmony_ci * the {@link MessageSequence}. 129361847f8eSopenharmony_ci * 129461847f8eSopenharmony_ci * @returns { number } Return the writable data space of the {@link MessageSequence} object. 129561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 129661847f8eSopenharmony_ci * @since 9 129761847f8eSopenharmony_ci */ 129861847f8eSopenharmony_ci getWritableBytes(): number; 129961847f8eSopenharmony_ci 130061847f8eSopenharmony_ci /** 130161847f8eSopenharmony_ci * Obtains the readable data space (in bytes) in the {@link MessageSequence} object. 130261847f8eSopenharmony_ci * <p>Readable data space = Size of data contained in the {@link MessageSequence} – Size of data that has been read. 130361847f8eSopenharmony_ci * 130461847f8eSopenharmony_ci * @returns { number } Return the readable data space of the {@link MessageSequence} object. 130561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 130661847f8eSopenharmony_ci * @since 9 130761847f8eSopenharmony_ci */ 130861847f8eSopenharmony_ci getReadableBytes(): number; 130961847f8eSopenharmony_ci 131061847f8eSopenharmony_ci /** 131161847f8eSopenharmony_ci * Obtains the current read position in the {@link MessageSequence} object. 131261847f8eSopenharmony_ci * 131361847f8eSopenharmony_ci * @returns { number } Return the current read position in the {@link MessageSequence} object. 131461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 131561847f8eSopenharmony_ci * @since 9 131661847f8eSopenharmony_ci */ 131761847f8eSopenharmony_ci getReadPosition(): number; 131861847f8eSopenharmony_ci 131961847f8eSopenharmony_ci /** 132061847f8eSopenharmony_ci * Obtains the current write position in the {@link MessageSequence} object. 132161847f8eSopenharmony_ci * 132261847f8eSopenharmony_ci * @returns { number } Return the current write position in the {@link MessageSequence} object. 132361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 132461847f8eSopenharmony_ci * @since 9 132561847f8eSopenharmony_ci */ 132661847f8eSopenharmony_ci getWritePosition(): number; 132761847f8eSopenharmony_ci 132861847f8eSopenharmony_ci /** 132961847f8eSopenharmony_ci * Changes the current read position in the {@link MessageSequence} object. 133061847f8eSopenharmony_ci * <p>Generally, you are advised not to change the current read position. If you must 133161847f8eSopenharmony_ci * change it, change it to an accurate position. Otherwise, the read data may be incorrect. 133261847f8eSopenharmony_ci * 133361847f8eSopenharmony_ci * @param { number } pos - Indicates the target position to start data reading. 133461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 133561847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 133661847f8eSopenharmony_ci * 2.The parameter type does not match. 133761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 133861847f8eSopenharmony_ci * @since 9 133961847f8eSopenharmony_ci */ 134061847f8eSopenharmony_ci rewindRead(pos: number): void; 134161847f8eSopenharmony_ci 134261847f8eSopenharmony_ci /** 134361847f8eSopenharmony_ci * Changes the current write position in the {@link MessageSequence} object. 134461847f8eSopenharmony_ci * <p>Generally, you are advised not to change the current write position. If you must 134561847f8eSopenharmony_ci * change it, change it to an accurate position. Otherwise, the data to be read may be incorrect. 134661847f8eSopenharmony_ci * 134761847f8eSopenharmony_ci * @param { number } pos - Indicates the target position to start data writing. 134861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 134961847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 135061847f8eSopenharmony_ci * 2.The parameter type does not match. 135161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 135261847f8eSopenharmony_ci * @since 9 135361847f8eSopenharmony_ci */ 135461847f8eSopenharmony_ci rewindWrite(pos: number): void; 135561847f8eSopenharmony_ci 135661847f8eSopenharmony_ci /** 135761847f8eSopenharmony_ci * Writes information to this MessageSequence object indicating that no exception occurred. 135861847f8eSopenharmony_ci * <p>After handling requests, you should call this method before writing any data to reply 135961847f8eSopenharmony_ci * {@link MessageSequence}. 136061847f8eSopenharmony_ci * 136161847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 136261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 136361847f8eSopenharmony_ci * @since 9 136461847f8eSopenharmony_ci */ 136561847f8eSopenharmony_ci writeNoException(): void; 136661847f8eSopenharmony_ci 136761847f8eSopenharmony_ci /** 136861847f8eSopenharmony_ci * Reads the exception information from this MessageSequence object. 136961847f8eSopenharmony_ci * <p>If exception was thrown in server side, it will be thrown here. 137061847f8eSopenharmony_ci * This method should be called before reading any data from reply {@link MessageSequence} 137161847f8eSopenharmony_ci * if {@link writeNoException} was invoked in server side. 137261847f8eSopenharmony_ci * 137361847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 137461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 137561847f8eSopenharmony_ci * @since 9 137661847f8eSopenharmony_ci */ 137761847f8eSopenharmony_ci readException(): void; 137861847f8eSopenharmony_ci 137961847f8eSopenharmony_ci /** 138061847f8eSopenharmony_ci * Writes a byte value into the {@link MessageSequence} object. 138161847f8eSopenharmony_ci * 138261847f8eSopenharmony_ci * @param { number } val - Indicates the byte value to write. 138361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 138461847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 138561847f8eSopenharmony_ci * 2.The parameter type does not match. 138661847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 138761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 138861847f8eSopenharmony_ci * @since 9 138961847f8eSopenharmony_ci */ 139061847f8eSopenharmony_ci writeByte(val: number): void; 139161847f8eSopenharmony_ci 139261847f8eSopenharmony_ci /** 139361847f8eSopenharmony_ci * Writes a short integer value into the {@link MessageSequence} object. 139461847f8eSopenharmony_ci * 139561847f8eSopenharmony_ci * @param { number } val - Indicates the short integer value to write. 139661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 139761847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 139861847f8eSopenharmony_ci * 2.The parameter type does not match. 139961847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 140061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 140161847f8eSopenharmony_ci * @since 9 140261847f8eSopenharmony_ci */ 140361847f8eSopenharmony_ci writeShort(val: number): void; 140461847f8eSopenharmony_ci 140561847f8eSopenharmony_ci /** 140661847f8eSopenharmony_ci * Writes an integer value into the {@link MessageSequence} object. 140761847f8eSopenharmony_ci * 140861847f8eSopenharmony_ci * @param { number } val - Indicates the integer value to write. 140961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 141061847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 141161847f8eSopenharmony_ci * 2.The parameter type does not match. 141261847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 141361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 141461847f8eSopenharmony_ci * @since 9 141561847f8eSopenharmony_ci */ 141661847f8eSopenharmony_ci writeInt(val: number): void; 141761847f8eSopenharmony_ci 141861847f8eSopenharmony_ci /** 141961847f8eSopenharmony_ci * Writes a long integer value into the {@link MessageSequence} object. 142061847f8eSopenharmony_ci * 142161847f8eSopenharmony_ci * @param { number } val - Indicates the long integer value to write. 142261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 142361847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 142461847f8eSopenharmony_ci * 2.The parameter type does not match. 142561847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 142661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 142761847f8eSopenharmony_ci * @since 9 142861847f8eSopenharmony_ci */ 142961847f8eSopenharmony_ci writeLong(val: number): void; 143061847f8eSopenharmony_ci 143161847f8eSopenharmony_ci /** 143261847f8eSopenharmony_ci * Writes a floating point value into the {@link MessageSequence} object. 143361847f8eSopenharmony_ci * 143461847f8eSopenharmony_ci * @param { number } val - Indicates the floating point value to write. 143561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 143661847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 143761847f8eSopenharmony_ci * 2.The parameter type does not match. 143861847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 143961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 144061847f8eSopenharmony_ci * @since 9 144161847f8eSopenharmony_ci */ 144261847f8eSopenharmony_ci writeFloat(val: number): void; 144361847f8eSopenharmony_ci 144461847f8eSopenharmony_ci /** 144561847f8eSopenharmony_ci * Writes a double-precision floating point value into the {@link MessageSequence} object. 144661847f8eSopenharmony_ci * 144761847f8eSopenharmony_ci * @param { number } val - Indicates the double-precision floating point value to write. 144861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 144961847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 145061847f8eSopenharmony_ci * 2.The parameter type does not match. 145161847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 145261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 145361847f8eSopenharmony_ci * @since 9 145461847f8eSopenharmony_ci */ 145561847f8eSopenharmony_ci writeDouble(val: number): void; 145661847f8eSopenharmony_ci 145761847f8eSopenharmony_ci /** 145861847f8eSopenharmony_ci * Writes a boolean value into the {@link MessageSequence} object. 145961847f8eSopenharmony_ci * 146061847f8eSopenharmony_ci * @param { boolean } val - Indicates the boolean value to write. 146161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 146261847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 146361847f8eSopenharmony_ci * 2.The parameter type does not match. 146461847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 146561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 146661847f8eSopenharmony_ci * @since 9 146761847f8eSopenharmony_ci */ 146861847f8eSopenharmony_ci writeBoolean(val: boolean): void; 146961847f8eSopenharmony_ci 147061847f8eSopenharmony_ci /** 147161847f8eSopenharmony_ci * Writes a single character value into the {@link MessageSequence} object. 147261847f8eSopenharmony_ci * 147361847f8eSopenharmony_ci * @param { number } val - Indicates the single character value to write. 147461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 147561847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 147661847f8eSopenharmony_ci * 2.The parameter type does not match. 147761847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 147861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 147961847f8eSopenharmony_ci * @since 9 148061847f8eSopenharmony_ci */ 148161847f8eSopenharmony_ci writeChar(val: number): void; 148261847f8eSopenharmony_ci 148361847f8eSopenharmony_ci /** 148461847f8eSopenharmony_ci * Writes a string value into the {@link MessageSequence} object. 148561847f8eSopenharmony_ci * 148661847f8eSopenharmony_ci * @param { string } val - Indicates the string value to write. 148761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 148861847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 148961847f8eSopenharmony_ci * 2.The parameter type does not match; 149061847f8eSopenharmony_ci * 3.The string length exceeds 40960 bytes; 149161847f8eSopenharmony_ci * 4.The number of bytes copied to the buffer is different from the length of the obtained string. 149261847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 149361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 149461847f8eSopenharmony_ci * @since 9 149561847f8eSopenharmony_ci */ 149661847f8eSopenharmony_ci writeString(val: string): void; 149761847f8eSopenharmony_ci 149861847f8eSopenharmony_ci /** 149961847f8eSopenharmony_ci * Writes a {@link Parcelable} object into the {@link MessageSequence} object. 150061847f8eSopenharmony_ci * 150161847f8eSopenharmony_ci * @param { Parcelable } val - Indicates the {@link Parcelable} object to write. 150261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 150361847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 150461847f8eSopenharmony_ci * 2.The parameter type does not match. 150561847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 150661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 150761847f8eSopenharmony_ci * @since 9 150861847f8eSopenharmony_ci */ 150961847f8eSopenharmony_ci writeParcelable(val: Parcelable): void; 151061847f8eSopenharmony_ci 151161847f8eSopenharmony_ci /** 151261847f8eSopenharmony_ci * Writes a byte array into the {@link MessageSequence} object. 151361847f8eSopenharmony_ci * 151461847f8eSopenharmony_ci * @param { number[] } byteArray - Indicates the byte array to write. 151561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 151661847f8eSopenharmony_ci * 1.The parameter is an empty array; 151761847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 151861847f8eSopenharmony_ci * 3.The parameter type does not match; 151961847f8eSopenharmony_ci * 4.The element does not exist in the array. 152061847f8eSopenharmony_ci * 5.The type of the element in the array is incorrect. 152161847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 152261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 152361847f8eSopenharmony_ci * @since 9 152461847f8eSopenharmony_ci */ 152561847f8eSopenharmony_ci writeByteArray(byteArray: number[]): void; 152661847f8eSopenharmony_ci 152761847f8eSopenharmony_ci /** 152861847f8eSopenharmony_ci * Writes a short integer array into the {@link MessageSequence} object. 152961847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 153061847f8eSopenharmony_ci * Otherwise,data may be truncated. 153161847f8eSopenharmony_ci * 153261847f8eSopenharmony_ci * @param { number[] } shortArray - Indicates the short integer array to write. 153361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 153461847f8eSopenharmony_ci * 1.The parameter is an empty array; 153561847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 153661847f8eSopenharmony_ci * 3.The parameter type does not match; 153761847f8eSopenharmony_ci * 4.The element does not exist in the array; 153861847f8eSopenharmony_ci * 5.The type of the element in the array is incorrect. 153961847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 154061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 154161847f8eSopenharmony_ci * @since 9 154261847f8eSopenharmony_ci */ 154361847f8eSopenharmony_ci writeShortArray(shortArray: number[]): void; 154461847f8eSopenharmony_ci 154561847f8eSopenharmony_ci /** 154661847f8eSopenharmony_ci * Writes an integer array into the {@link MessageSequence} object. 154761847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 154861847f8eSopenharmony_ci * Otherwise,data may be truncated. 154961847f8eSopenharmony_ci * 155061847f8eSopenharmony_ci * @param { number[] } intArray - Indicates the integer array to write. 155161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 155261847f8eSopenharmony_ci * 1.The parameter is an empty array; 155361847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 155461847f8eSopenharmony_ci * 3.The parameter type does not match; 155561847f8eSopenharmony_ci * 4.The element does not exist in the array; 155661847f8eSopenharmony_ci * 5.The type of the element in the array is incorrect. 155761847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 155861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 155961847f8eSopenharmony_ci * @since 9 156061847f8eSopenharmony_ci */ 156161847f8eSopenharmony_ci writeIntArray(intArray: number[]): void; 156261847f8eSopenharmony_ci 156361847f8eSopenharmony_ci /** 156461847f8eSopenharmony_ci * Writes a long integer array into the {@link MessageSequence} object. 156561847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 156661847f8eSopenharmony_ci * Otherwise,data may be truncated. 156761847f8eSopenharmony_ci * 156861847f8eSopenharmony_ci * @param { number[] } longArray - Indicates the long integer array to write. 156961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 157061847f8eSopenharmony_ci * 1.The parameter is an empty array; 157161847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 157261847f8eSopenharmony_ci * 3.The parameter type does not match; 157361847f8eSopenharmony_ci * 4.The element does not exist in the array; 157461847f8eSopenharmony_ci * 5.The type of the element in the array is incorrect. 157561847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 157661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 157761847f8eSopenharmony_ci * @since 9 157861847f8eSopenharmony_ci */ 157961847f8eSopenharmony_ci writeLongArray(longArray: number[]): void; 158061847f8eSopenharmony_ci 158161847f8eSopenharmony_ci /** 158261847f8eSopenharmony_ci * Writes a floating point array into the {@link MessageSequence} object. 158361847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 158461847f8eSopenharmony_ci * Otherwise,data may be truncated. 158561847f8eSopenharmony_ci * 158661847f8eSopenharmony_ci * @param { number[] } floatArray - Indicates the floating point array to write. 158761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 158861847f8eSopenharmony_ci * 1.The parameter is an empty array; 158961847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 159061847f8eSopenharmony_ci * 3.The parameter type does not match; 159161847f8eSopenharmony_ci * 4.The element does not exist in the array; 159261847f8eSopenharmony_ci * 5.The type of the element in the array is incorrect. 159361847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 159461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 159561847f8eSopenharmony_ci * @since 9 159661847f8eSopenharmony_ci */ 159761847f8eSopenharmony_ci writeFloatArray(floatArray: number[]): void; 159861847f8eSopenharmony_ci 159961847f8eSopenharmony_ci /** 160061847f8eSopenharmony_ci * Writes a double-precision floating point array into the {@link MessageSequence} object. 160161847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 160261847f8eSopenharmony_ci * Otherwise,data may be truncated. 160361847f8eSopenharmony_ci * 160461847f8eSopenharmony_ci * @param { number[] } doubleArray - Indicates the double-precision floating point array to write. 160561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 160661847f8eSopenharmony_ci * 1.The parameter is an empty array; 160761847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 160861847f8eSopenharmony_ci * 3.The parameter type does not match; 160961847f8eSopenharmony_ci * 4.The element does not exist in the array; 161061847f8eSopenharmony_ci * 5.The type of the element in the array is incorrect. 161161847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 161261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 161361847f8eSopenharmony_ci * @since 9 161461847f8eSopenharmony_ci */ 161561847f8eSopenharmony_ci writeDoubleArray(doubleArray: number[]): void; 161661847f8eSopenharmony_ci 161761847f8eSopenharmony_ci /** 161861847f8eSopenharmony_ci * Writes a boolean array into the {@link MessageSequence} object. 161961847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 162061847f8eSopenharmony_ci * Otherwise,data may be truncated. 162161847f8eSopenharmony_ci * 162261847f8eSopenharmony_ci * @param { boolean[] } booleanArray - Indicates the boolean array to write. 162361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 162461847f8eSopenharmony_ci * 1.The parameter is an empty array; 162561847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 162661847f8eSopenharmony_ci * 3.The parameter type does not match; 162761847f8eSopenharmony_ci * 4.The element does not exist in the array. 162861847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 162961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 163061847f8eSopenharmony_ci * @since 9 163161847f8eSopenharmony_ci */ 163261847f8eSopenharmony_ci writeBooleanArray(booleanArray: boolean[]): void; 163361847f8eSopenharmony_ci 163461847f8eSopenharmony_ci /** 163561847f8eSopenharmony_ci * Writes a single character array into the {@link MessageSequence} object. 163661847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 163761847f8eSopenharmony_ci * Otherwise,data may be truncated. 163861847f8eSopenharmony_ci * 163961847f8eSopenharmony_ci * @param { number[] } charArray - Indicates the single character array to write. 164061847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 164161847f8eSopenharmony_ci * 1.The parameter is an empty array; 164261847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 164361847f8eSopenharmony_ci * 3.The parameter type does not match; 164461847f8eSopenharmony_ci * 4.The element does not exist in the array. 164561847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 164661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 164761847f8eSopenharmony_ci * @since 9 164861847f8eSopenharmony_ci */ 164961847f8eSopenharmony_ci writeCharArray(charArray: number[]): void; 165061847f8eSopenharmony_ci 165161847f8eSopenharmony_ci /** 165261847f8eSopenharmony_ci * Writes a string array into the {@link MessageSequence} object. 165361847f8eSopenharmony_ci * Ensure that the data type and size comply with the interface definition. 165461847f8eSopenharmony_ci * Otherwise,data may be truncated. 165561847f8eSopenharmony_ci * 165661847f8eSopenharmony_ci * @param { string[] } stringArray - Indicates the string array to write. 165761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 165861847f8eSopenharmony_ci * 1.The parameter is an empty array; 165961847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 166061847f8eSopenharmony_ci * 3.The parameter type does not match; 166161847f8eSopenharmony_ci * 4.The string length exceeds 40960 bytes; 166261847f8eSopenharmony_ci * 5.The number of bytes copied to the buffer is different from the length of the obtained string. 166361847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 166461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 166561847f8eSopenharmony_ci * @since 9 166661847f8eSopenharmony_ci */ 166761847f8eSopenharmony_ci writeStringArray(stringArray: string[]): void; 166861847f8eSopenharmony_ci 166961847f8eSopenharmony_ci /** 167061847f8eSopenharmony_ci * Writes a {@link Parcelable} object array into the {@link MessageSequence} object. 167161847f8eSopenharmony_ci * 167261847f8eSopenharmony_ci * @param { Parcelable[] } parcelableArray - Indicates the {@link Parcelable} object array to write. 167361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 167461847f8eSopenharmony_ci * 1.The parameter is an empty array; 167561847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 167661847f8eSopenharmony_ci * 3.The parameter type does not match; 167761847f8eSopenharmony_ci * 4.The element does not exist in the array. 167861847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 167961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 168061847f8eSopenharmony_ci * @since 9 168161847f8eSopenharmony_ci */ 168261847f8eSopenharmony_ci writeParcelableArray(parcelableArray: Parcelable[]): void; 168361847f8eSopenharmony_ci 168461847f8eSopenharmony_ci /** 168561847f8eSopenharmony_ci * Writes an array of {@link IRemoteObject} objects to this {@link MessageSequence} object. 168661847f8eSopenharmony_ci * 168761847f8eSopenharmony_ci * @param { IRemoteObject[] } objectArray - Array of {@link IRemoteObject} objects to write. 168861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 168961847f8eSopenharmony_ci * 1.The parameter is an empty array; 169061847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 169161847f8eSopenharmony_ci * 3.The parameter type does not match; 169261847f8eSopenharmony_ci * 4.The element does not exist in the array; 169361847f8eSopenharmony_ci * 5.The obtained remoteObject is null. 169461847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 169561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 169661847f8eSopenharmony_ci * @since 9 169761847f8eSopenharmony_ci */ 169861847f8eSopenharmony_ci writeRemoteObjectArray(objectArray: IRemoteObject[]): void; 169961847f8eSopenharmony_ci 170061847f8eSopenharmony_ci /** 170161847f8eSopenharmony_ci * Reads a byte value from the {@link MessageParcel} object. 170261847f8eSopenharmony_ci * 170361847f8eSopenharmony_ci * @returns { number } Return a byte value. 170461847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 170561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 170661847f8eSopenharmony_ci * @since 9 170761847f8eSopenharmony_ci */ 170861847f8eSopenharmony_ci readByte(): number; 170961847f8eSopenharmony_ci 171061847f8eSopenharmony_ci /** 171161847f8eSopenharmony_ci * Reads a short integer value from the {@link MessageSequence} object. 171261847f8eSopenharmony_ci * 171361847f8eSopenharmony_ci * @returns { number } Return a short integer value. 171461847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 171561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 171661847f8eSopenharmony_ci * @since 9 171761847f8eSopenharmony_ci */ 171861847f8eSopenharmony_ci readShort(): number; 171961847f8eSopenharmony_ci 172061847f8eSopenharmony_ci /** 172161847f8eSopenharmony_ci * Reads an integer value from the {@link MessageSequence} object. 172261847f8eSopenharmony_ci * 172361847f8eSopenharmony_ci * @returns { number } Return an integer value. 172461847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 172561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 172661847f8eSopenharmony_ci * @since 9 172761847f8eSopenharmony_ci */ 172861847f8eSopenharmony_ci readInt(): number; 172961847f8eSopenharmony_ci 173061847f8eSopenharmony_ci /** 173161847f8eSopenharmony_ci * Reads a long integer value from the {@link MessageSequence} object. 173261847f8eSopenharmony_ci * 173361847f8eSopenharmony_ci * @returns { number } Return a long integer value. 173461847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 173561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 173661847f8eSopenharmony_ci * @since 9 173761847f8eSopenharmony_ci */ 173861847f8eSopenharmony_ci readLong(): number; 173961847f8eSopenharmony_ci 174061847f8eSopenharmony_ci /** 174161847f8eSopenharmony_ci * Reads a floating point value from the {@link MessageSequence} object. 174261847f8eSopenharmony_ci * 174361847f8eSopenharmony_ci * @returns { number } Return a floating point value. 174461847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 174561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 174661847f8eSopenharmony_ci * @since 9 174761847f8eSopenharmony_ci */ 174861847f8eSopenharmony_ci readFloat(): number; 174961847f8eSopenharmony_ci 175061847f8eSopenharmony_ci /** 175161847f8eSopenharmony_ci * Reads a double-precision floating point value from the {@link MessageSequence} object. 175261847f8eSopenharmony_ci * 175361847f8eSopenharmony_ci * @returns { number } Return a double-precision floating point value. 175461847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 175561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 175661847f8eSopenharmony_ci * @since 9 175761847f8eSopenharmony_ci */ 175861847f8eSopenharmony_ci readDouble(): number; 175961847f8eSopenharmony_ci 176061847f8eSopenharmony_ci /** 176161847f8eSopenharmony_ci * Reads a boolean value from the {@link MessageSequence} object. 176261847f8eSopenharmony_ci * 176361847f8eSopenharmony_ci * @returns { boolean } Return a boolean value. 176461847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 176561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 176661847f8eSopenharmony_ci * @since 9 176761847f8eSopenharmony_ci */ 176861847f8eSopenharmony_ci readBoolean(): boolean; 176961847f8eSopenharmony_ci 177061847f8eSopenharmony_ci /** 177161847f8eSopenharmony_ci * Reads a single character value from the {@link MessageSequence} object. 177261847f8eSopenharmony_ci * 177361847f8eSopenharmony_ci * @returns { number } Return a single character value. 177461847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 177561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 177661847f8eSopenharmony_ci * @since 9 177761847f8eSopenharmony_ci */ 177861847f8eSopenharmony_ci readChar(): number; 177961847f8eSopenharmony_ci 178061847f8eSopenharmony_ci /** 178161847f8eSopenharmony_ci * Reads a string value from the {@link MessageSequence} object. 178261847f8eSopenharmony_ci * 178361847f8eSopenharmony_ci * @returns { string } Return a string value. 178461847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 178561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 178661847f8eSopenharmony_ci * @since 9 178761847f8eSopenharmony_ci */ 178861847f8eSopenharmony_ci readString(): string; 178961847f8eSopenharmony_ci 179061847f8eSopenharmony_ci /** 179161847f8eSopenharmony_ci * Reads a {@link Parcelable} object from the {@link MessageSequence} instance. 179261847f8eSopenharmony_ci * 179361847f8eSopenharmony_ci * @param { Parcelable } dataIn - Indicates the {@link Parcelable} object that needs to perform 179461847f8eSopenharmony_ci * the {@code unmarshalling} operation using the {@link MessageSequence}. 179561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 179661847f8eSopenharmony_ci * 1.The number of parameters is incorrect. 179761847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 179861847f8eSopenharmony_ci * @throws { BusinessError } 1900012 - Failed to call the JS callback function. 179961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 180061847f8eSopenharmony_ci * @since 9 180161847f8eSopenharmony_ci */ 180261847f8eSopenharmony_ci readParcelable(dataIn: Parcelable): void; 180361847f8eSopenharmony_ci 180461847f8eSopenharmony_ci /** 180561847f8eSopenharmony_ci * Writes a byte array into the {@link MessageSequence} object. 180661847f8eSopenharmony_ci * 180761847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the byte array read from MessageSequence. 180861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 180961847f8eSopenharmony_ci * 1.The parameter is an empty array; 181061847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 181161847f8eSopenharmony_ci * 3.The parameter type does not match. 181261847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 181361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 181461847f8eSopenharmony_ci * @since 9 181561847f8eSopenharmony_ci */ 181661847f8eSopenharmony_ci readByteArray(dataIn: number[]): void; 181761847f8eSopenharmony_ci 181861847f8eSopenharmony_ci /** 181961847f8eSopenharmony_ci * Reads a byte array from the {@link MessageSequence} object. 182061847f8eSopenharmony_ci * 182161847f8eSopenharmony_ci * @returns { number[] } Return a byte array. 182261847f8eSopenharmony_ci * @throws { BusinessError } 401 - check param failed 182361847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 182461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 182561847f8eSopenharmony_ci * @since 9 182661847f8eSopenharmony_ci */ 182761847f8eSopenharmony_ci readByteArray(): number[]; 182861847f8eSopenharmony_ci 182961847f8eSopenharmony_ci /** 183061847f8eSopenharmony_ci * Reads a short integer array from the {@link MessageSequence} object. 183161847f8eSopenharmony_ci * 183261847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the short integer array read from MessageSequence. 183361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 183461847f8eSopenharmony_ci * 1.The parameter is an empty array; 183561847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 183661847f8eSopenharmony_ci * 3.The parameter type does not match. 183761847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 183861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 183961847f8eSopenharmony_ci * @since 9 184061847f8eSopenharmony_ci */ 184161847f8eSopenharmony_ci readShortArray(dataIn: number[]): void; 184261847f8eSopenharmony_ci 184361847f8eSopenharmony_ci /** 184461847f8eSopenharmony_ci * Reads a short integer array from the {@link MessageSequence} object. 184561847f8eSopenharmony_ci * 184661847f8eSopenharmony_ci * @returns { number[] } Return a short integer array. 184761847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 184861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 184961847f8eSopenharmony_ci * @since 9 185061847f8eSopenharmony_ci */ 185161847f8eSopenharmony_ci readShortArray(): number[]; 185261847f8eSopenharmony_ci 185361847f8eSopenharmony_ci /** 185461847f8eSopenharmony_ci * Reads an integer array from the {@link MessageSequence} object. 185561847f8eSopenharmony_ci * 185661847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the integer array to read. 185761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 185861847f8eSopenharmony_ci * 1.The parameter is an empty array; 185961847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 186061847f8eSopenharmony_ci * 3.The parameter type does not match. 186161847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 186261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 186361847f8eSopenharmony_ci * @since 9 186461847f8eSopenharmony_ci */ 186561847f8eSopenharmony_ci readIntArray(dataIn: number[]): void; 186661847f8eSopenharmony_ci 186761847f8eSopenharmony_ci /** 186861847f8eSopenharmony_ci * Reads an integer array from the {@link MessageSequence} object. 186961847f8eSopenharmony_ci * 187061847f8eSopenharmony_ci * @returns { number[] } Return an integer array. 187161847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 187261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 187361847f8eSopenharmony_ci * @since 9 187461847f8eSopenharmony_ci */ 187561847f8eSopenharmony_ci readIntArray(): number[]; 187661847f8eSopenharmony_ci 187761847f8eSopenharmony_ci /** 187861847f8eSopenharmony_ci * Reads a long integer array from the {@link MessageSequence} object. 187961847f8eSopenharmony_ci * 188061847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the long integer array to read. 188161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 188261847f8eSopenharmony_ci * 1.The parameter is an empty array; 188361847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 188461847f8eSopenharmony_ci * 3.The parameter type does not match. 188561847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 188661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 188761847f8eSopenharmony_ci * @since 9 188861847f8eSopenharmony_ci */ 188961847f8eSopenharmony_ci readLongArray(dataIn: number[]): void; 189061847f8eSopenharmony_ci 189161847f8eSopenharmony_ci /** 189261847f8eSopenharmony_ci * Reads a long integer array from the {@link MessageSequence} object. 189361847f8eSopenharmony_ci * 189461847f8eSopenharmony_ci * @returns { number[] } Return a long integer array. 189561847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 189661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 189761847f8eSopenharmony_ci * @since 9 189861847f8eSopenharmony_ci */ 189961847f8eSopenharmony_ci readLongArray(): number[]; 190061847f8eSopenharmony_ci 190161847f8eSopenharmony_ci /** 190261847f8eSopenharmony_ci * Reads a floating point array from the {@link MessageSequence} object. 190361847f8eSopenharmony_ci * 190461847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the floating point array to read. 190561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 190661847f8eSopenharmony_ci * 1.The parameter is an empty array; 190761847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 190861847f8eSopenharmony_ci * 3.The parameter type does not match. 190961847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 191061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 191161847f8eSopenharmony_ci * @since 9 191261847f8eSopenharmony_ci */ 191361847f8eSopenharmony_ci readFloatArray(dataIn: number[]): void; 191461847f8eSopenharmony_ci 191561847f8eSopenharmony_ci /** 191661847f8eSopenharmony_ci * Reads a floating point array from the {@link MessageSequence} object. 191761847f8eSopenharmony_ci * 191861847f8eSopenharmony_ci * @returns { number[] } Return a floating point array. 191961847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 192061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 192161847f8eSopenharmony_ci * @since 9 192261847f8eSopenharmony_ci */ 192361847f8eSopenharmony_ci readFloatArray(): number[]; 192461847f8eSopenharmony_ci 192561847f8eSopenharmony_ci /** 192661847f8eSopenharmony_ci * Reads a double-precision floating point array from the {@link MessageSequence} object. 192761847f8eSopenharmony_ci * 192861847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the double-precision floating point array to read. 192961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 193061847f8eSopenharmony_ci * 1.The parameter is an empty array; 193161847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 193261847f8eSopenharmony_ci * 3.The parameter type does not match. 193361847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 193461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 193561847f8eSopenharmony_ci * @since 9 193661847f8eSopenharmony_ci */ 193761847f8eSopenharmony_ci readDoubleArray(dataIn: number[]): void; 193861847f8eSopenharmony_ci 193961847f8eSopenharmony_ci /** 194061847f8eSopenharmony_ci * Reads a double-precision floating point array from the {@link MessageSequence} object. 194161847f8eSopenharmony_ci * 194261847f8eSopenharmony_ci * @returns { number[] } Return a double-precision floating point array. 194361847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 194461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 194561847f8eSopenharmony_ci * @since 9 194661847f8eSopenharmony_ci */ 194761847f8eSopenharmony_ci readDoubleArray(): number[]; 194861847f8eSopenharmony_ci 194961847f8eSopenharmony_ci /** 195061847f8eSopenharmony_ci * Reads a boolean array from the {@link MessageSequence} object. 195161847f8eSopenharmony_ci * 195261847f8eSopenharmony_ci * @param { boolean[] } dataIn - Indicates the boolean array to read. 195361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 195461847f8eSopenharmony_ci * 1.The parameter is an empty array; 195561847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 195661847f8eSopenharmony_ci * 3.The parameter type does not match. 195761847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 195861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 195961847f8eSopenharmony_ci * @since 9 196061847f8eSopenharmony_ci */ 196161847f8eSopenharmony_ci readBooleanArray(dataIn: boolean[]): void; 196261847f8eSopenharmony_ci 196361847f8eSopenharmony_ci /** 196461847f8eSopenharmony_ci * Reads a boolean array from the {@link MessageSequence} object. 196561847f8eSopenharmony_ci * 196661847f8eSopenharmony_ci * @returns { boolean[] } Return a boolean array. 196761847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 196861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 196961847f8eSopenharmony_ci * @since 9 197061847f8eSopenharmony_ci */ 197161847f8eSopenharmony_ci readBooleanArray(): boolean[]; 197261847f8eSopenharmony_ci 197361847f8eSopenharmony_ci /** 197461847f8eSopenharmony_ci * Reads a single character array from the {@link MessageSequence} object. 197561847f8eSopenharmony_ci * 197661847f8eSopenharmony_ci * @param { number[] } dataIn - Indicates the single character array to read. 197761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 197861847f8eSopenharmony_ci * 1.The parameter is an empty array; 197961847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 198061847f8eSopenharmony_ci * 3.The parameter type does not match. 198161847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 198261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 198361847f8eSopenharmony_ci * @since 9 198461847f8eSopenharmony_ci */ 198561847f8eSopenharmony_ci readCharArray(dataIn: number[]): void; 198661847f8eSopenharmony_ci 198761847f8eSopenharmony_ci /** 198861847f8eSopenharmony_ci * Reads a single character array from the {@link MessageSequence} object. 198961847f8eSopenharmony_ci * 199061847f8eSopenharmony_ci * @returns { number[] } Return a single character array. 199161847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 199261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 199361847f8eSopenharmony_ci * @since 9 199461847f8eSopenharmony_ci */ 199561847f8eSopenharmony_ci readCharArray(): number[]; 199661847f8eSopenharmony_ci 199761847f8eSopenharmony_ci /** 199861847f8eSopenharmony_ci * Reads a string array from the {@link MessageSequence} object. 199961847f8eSopenharmony_ci * 200061847f8eSopenharmony_ci * @param { string[] } dataIn - Indicates the string array to read. 200161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 200261847f8eSopenharmony_ci * 1.The parameter is an empty array; 200361847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 200461847f8eSopenharmony_ci * 3.The parameter type does not match. 200561847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 200661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 200761847f8eSopenharmony_ci * @since 9 200861847f8eSopenharmony_ci */ 200961847f8eSopenharmony_ci readStringArray(dataIn: string[]): void; 201061847f8eSopenharmony_ci 201161847f8eSopenharmony_ci /** 201261847f8eSopenharmony_ci * Reads a string array from the {@link MessageSequence} object. 201361847f8eSopenharmony_ci * 201461847f8eSopenharmony_ci * @returns { string[] } Return a string array. 201561847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 201661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 201761847f8eSopenharmony_ci * @since 9 201861847f8eSopenharmony_ci */ 201961847f8eSopenharmony_ci readStringArray(): string[]; 202061847f8eSopenharmony_ci 202161847f8eSopenharmony_ci /** 202261847f8eSopenharmony_ci * Reads the specified {@link Parcelable} array from this {@link MessageSequence} object. 202361847f8eSopenharmony_ci * 202461847f8eSopenharmony_ci * @param { Parcelable[] } parcelableArray - Parcelable array to read. 202561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 202661847f8eSopenharmony_ci * 1.The parameter is an empty array; 202761847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 202861847f8eSopenharmony_ci * 3.The parameter type does not match; 202961847f8eSopenharmony_ci * 4.The length of the array passed when reading is not equal to the length passed when writing to the array; 203061847f8eSopenharmony_ci * 5.The element does not exist in the array. 203161847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 203261847f8eSopenharmony_ci * @throws { BusinessError } 1900012 - Failed to call the JS callback function. 203361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 203461847f8eSopenharmony_ci * @since 9 203561847f8eSopenharmony_ci */ 203661847f8eSopenharmony_ci readParcelableArray(parcelableArray: Parcelable[]): void; 203761847f8eSopenharmony_ci 203861847f8eSopenharmony_ci /** 203961847f8eSopenharmony_ci * Reads the specified {@link IRemoteObject} array from this {@link MessageSequence} object. 204061847f8eSopenharmony_ci * 204161847f8eSopenharmony_ci * @param { IRemoteObject[] } objects - Reads data from this {@link MessageSequence} object to 204261847f8eSopenharmony_ci * the specified {@link IRemoteObject} array. 204361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 204461847f8eSopenharmony_ci * 1.The parameter is an empty array; 204561847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 204661847f8eSopenharmony_ci * 3.The parameter type does not match; 204761847f8eSopenharmony_ci * 4.The length of the array passed when reading is not equal to the length passed when writing to the array. 204861847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 204961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 205061847f8eSopenharmony_ci * @since 9 205161847f8eSopenharmony_ci */ 205261847f8eSopenharmony_ci readRemoteObjectArray(objects: IRemoteObject[]): void; 205361847f8eSopenharmony_ci 205461847f8eSopenharmony_ci /** 205561847f8eSopenharmony_ci * Reads {@link IRemoteObject} objects from this {@link MessageSequence} object. 205661847f8eSopenharmony_ci * 205761847f8eSopenharmony_ci * @returns { IRemoteObject[] } Return an array of {@link IRemoteObject} objects obtained. 205861847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 205961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 206061847f8eSopenharmony_ci * @since 9 206161847f8eSopenharmony_ci */ 206261847f8eSopenharmony_ci readRemoteObjectArray(): IRemoteObject[]; 206361847f8eSopenharmony_ci 206461847f8eSopenharmony_ci /** 206561847f8eSopenharmony_ci * Closes the specified file descriptor. 206661847f8eSopenharmony_ci * 206761847f8eSopenharmony_ci * @param { number } fd - File descriptor to be closed. 206861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 206961847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 207061847f8eSopenharmony_ci * 2.The parameter type does not match. 207161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 207261847f8eSopenharmony_ci * @since 9 207361847f8eSopenharmony_ci */ 207461847f8eSopenharmony_ci static closeFileDescriptor(fd: number): void; 207561847f8eSopenharmony_ci 207661847f8eSopenharmony_ci /** 207761847f8eSopenharmony_ci * Duplicates the specified file descriptor. 207861847f8eSopenharmony_ci * 207961847f8eSopenharmony_ci * @param { number } fd - File descriptor to be duplicated. 208061847f8eSopenharmony_ci * @returns { number } Return a duplicated file descriptor. 208161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 208261847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 208361847f8eSopenharmony_ci * 2.The parameter type does not match. 208461847f8eSopenharmony_ci * @throws { BusinessError } 1900013 - Failed to call dup. 208561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 208661847f8eSopenharmony_ci * @since 9 208761847f8eSopenharmony_ci */ 208861847f8eSopenharmony_ci static dupFileDescriptor(fd: number): number; 208961847f8eSopenharmony_ci 209061847f8eSopenharmony_ci /** 209161847f8eSopenharmony_ci * Checks whether this {@link MessageSequence} object contains a file descriptor. 209261847f8eSopenharmony_ci * 209361847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the {@link MessageSequence} object contains a file descriptor; 209461847f8eSopenharmony_ci * return {@code false} otherwise. 209561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 209661847f8eSopenharmony_ci * @since 9 209761847f8eSopenharmony_ci */ 209861847f8eSopenharmony_ci containFileDescriptors(): boolean; 209961847f8eSopenharmony_ci 210061847f8eSopenharmony_ci /** 210161847f8eSopenharmony_ci * Writes a file descriptor to this {@link MessageSequence} object. 210261847f8eSopenharmony_ci * 210361847f8eSopenharmony_ci * @param { number } fd - File descriptor to wrote. 210461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 210561847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 210661847f8eSopenharmony_ci * 2.The parameter type does not match. 210761847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 210861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 210961847f8eSopenharmony_ci * @since 9 211061847f8eSopenharmony_ci */ 211161847f8eSopenharmony_ci writeFileDescriptor(fd: number): void; 211261847f8eSopenharmony_ci 211361847f8eSopenharmony_ci /** 211461847f8eSopenharmony_ci * Reads a file descriptor from this {@link MessageSequence} object. 211561847f8eSopenharmony_ci * 211661847f8eSopenharmony_ci * @returns { number } Return a file descriptor obtained. 211761847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 211861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 211961847f8eSopenharmony_ci * @since 9 212061847f8eSopenharmony_ci */ 212161847f8eSopenharmony_ci readFileDescriptor(): number; 212261847f8eSopenharmony_ci 212361847f8eSopenharmony_ci /** 212461847f8eSopenharmony_ci * Writes an anonymous shared memory object to this {@link MessageSequence} object. 212561847f8eSopenharmony_ci * 212661847f8eSopenharmony_ci * @param { Ashmem } ashmem - Anonymous shared memory object to wrote. 212761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 212861847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 212961847f8eSopenharmony_ci * 2.The parameter is not an instance of the Ashmem object. 213061847f8eSopenharmony_ci * @throws { BusinessError } 1900003 - Failed to write data to the shared memory. 213161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 213261847f8eSopenharmony_ci * @since 9 213361847f8eSopenharmony_ci */ 213461847f8eSopenharmony_ci writeAshmem(ashmem: Ashmem): void; 213561847f8eSopenharmony_ci 213661847f8eSopenharmony_ci /** 213761847f8eSopenharmony_ci * Reads the anonymous shared memory object from this {@link MessageSequence} object. 213861847f8eSopenharmony_ci * 213961847f8eSopenharmony_ci * @returns { Ashmem } Return the anonymous share object obtained. 214061847f8eSopenharmony_ci * @throws { BusinessError } 401 - check param failed 214161847f8eSopenharmony_ci * @throws { BusinessError } 1900004 - Failed to read data from the shared memory. 214261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 214361847f8eSopenharmony_ci * @since 9 214461847f8eSopenharmony_ci */ 214561847f8eSopenharmony_ci readAshmem(): Ashmem; 214661847f8eSopenharmony_ci 214761847f8eSopenharmony_ci /** 214861847f8eSopenharmony_ci * Obtains the maximum amount of raw data that can be sent in a time. 214961847f8eSopenharmony_ci * 215061847f8eSopenharmony_ci * @returns { number } 128 MB. 215161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 215261847f8eSopenharmony_ci * @since 9 215361847f8eSopenharmony_ci */ 215461847f8eSopenharmony_ci getRawDataCapacity(): number; 215561847f8eSopenharmony_ci 215661847f8eSopenharmony_ci /** 215761847f8eSopenharmony_ci * Writes raw data to this {@link MessageSequence} object. 215861847f8eSopenharmony_ci * 215961847f8eSopenharmony_ci * @param { number[] } rawData - Raw data to wrote. 216061847f8eSopenharmony_ci * @param { number } size - Size of the raw data, in bytes. 216161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 216261847f8eSopenharmony_ci * 1.The parameter is an empty array; 216361847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 216461847f8eSopenharmony_ci * 3.The parameter type does not match; 216561847f8eSopenharmony_ci * 4.The transferred size cannot be obtained; 216661847f8eSopenharmony_ci * 5.The transferred size is less than or equal to 0; 216761847f8eSopenharmony_ci * 6.The element does not exist in the array; 216861847f8eSopenharmony_ci * 7.Failed to obtain typedArray information; 216961847f8eSopenharmony_ci * 8.The array is not of type int32; 217061847f8eSopenharmony_ci * 9.The length of typedarray is smaller than the size of the original data sent. 217161847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 217261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 217361847f8eSopenharmony_ci * @since 9 217461847f8eSopenharmony_ci * @deprecated since 11 217561847f8eSopenharmony_ci * @useinstead ohos.rpc.MessageSequence#writeRawDataBuffer 217661847f8eSopenharmony_ci */ 217761847f8eSopenharmony_ci writeRawData(rawData: number[], size: number): void; 217861847f8eSopenharmony_ci 217961847f8eSopenharmony_ci /** 218061847f8eSopenharmony_ci * Writes raw data to this {@link MessageSequence} object. 218161847f8eSopenharmony_ci * 218261847f8eSopenharmony_ci * @param { ArrayBuffer } rawData - Raw data to wrote. 218361847f8eSopenharmony_ci * @param { number } size - Size of the raw data, in bytes. 218461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 218561847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 218661847f8eSopenharmony_ci * 2.The parameter type does not match; 218761847f8eSopenharmony_ci * 3.Failed to obtain arrayBuffer information; 218861847f8eSopenharmony_ci * 4.The transferred size cannot be obtained; 218961847f8eSopenharmony_ci * 5.The transferred size is less than or equal to 0; 219061847f8eSopenharmony_ci * 6.The transferred size is greater than the byte length of ArrayBuffer. 219161847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 219261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 219361847f8eSopenharmony_ci * @since 11 219461847f8eSopenharmony_ci */ 219561847f8eSopenharmony_ci writeRawDataBuffer(rawData: ArrayBuffer, size: number): void; 219661847f8eSopenharmony_ci 219761847f8eSopenharmony_ci /** 219861847f8eSopenharmony_ci * Reads raw data from this {@link MessageSequence} object. 219961847f8eSopenharmony_ci * 220061847f8eSopenharmony_ci * @param { number } size - Size of the raw data to read. 220161847f8eSopenharmony_ci * @returns { number[] } Return the raw data obtained, in bytes. 220261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 220361847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 220461847f8eSopenharmony_ci * 2.The parameter type does not match. 220561847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 220661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 220761847f8eSopenharmony_ci * @since 9 220861847f8eSopenharmony_ci * @deprecated since 11 220961847f8eSopenharmony_ci * @useinstead ohos.rpc.MessageSequence#readRawDataBuffer 221061847f8eSopenharmony_ci */ 221161847f8eSopenharmony_ci readRawData(size: number): number[]; 221261847f8eSopenharmony_ci 221361847f8eSopenharmony_ci /** 221461847f8eSopenharmony_ci * Reads raw data from this {@link MessageSequence} object. 221561847f8eSopenharmony_ci * 221661847f8eSopenharmony_ci * @param { number } size - Size of the raw data to read. 221761847f8eSopenharmony_ci * @returns { ArrayBuffer } Return the raw data obtained, in bytes. 221861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 221961847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 222061847f8eSopenharmony_ci * 2.The parameter type does not match. 222161847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 222261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 222361847f8eSopenharmony_ci * @since 11 222461847f8eSopenharmony_ci */ 222561847f8eSopenharmony_ci readRawDataBuffer(size: number): ArrayBuffer; 222661847f8eSopenharmony_ci 222761847f8eSopenharmony_ci /** 222861847f8eSopenharmony_ci * Writes the data in an ArrayBuffer object into this {@Link MessageSequence} object. 222961847f8eSopenharmony_ci * 223061847f8eSopenharmony_ci * @param { ArrayBuffer } buf - Data to write. 223161847f8eSopenharmony_ci * @param { TypeCode } typeCode - Type of the ArrayBuffer data to write. 223261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 223361847f8eSopenharmony_ci * 1.The parameter is an empty array; 223461847f8eSopenharmony_ci * 2.The number of parameters is incorrect; 223561847f8eSopenharmony_ci * 3.The parameter type does not match; 223661847f8eSopenharmony_ci * 4.The obtained value of typeCode is incorrect; 223761847f8eSopenharmony_ci * 5.Failed to obtain arrayBuffer information. 223861847f8eSopenharmony_ci * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. 223961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 224061847f8eSopenharmony_ci * @since 12 224161847f8eSopenharmony_ci */ 224261847f8eSopenharmony_ci writeArrayBuffer(buf: ArrayBuffer, typeCode: TypeCode): void; 224361847f8eSopenharmony_ci 224461847f8eSopenharmony_ci /** 224561847f8eSopenharmony_ci * Reads raw data from this {@link MessageSequence} object. 224661847f8eSopenharmony_ci * 224761847f8eSopenharmony_ci * @param { TypeCode } typeCode - Type of the ArrayBuffer read. 224861847f8eSopenharmony_ci * @returns { ArrayBuffer } Returns the Arraybuffer obtained. 224961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 225061847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 225161847f8eSopenharmony_ci * 2.The parameter type does not match; 225261847f8eSopenharmony_ci * 3.The obtained value of typeCode is incorrect; 225361847f8eSopenharmony_ci * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. 225461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 225561847f8eSopenharmony_ci * @since 12 225661847f8eSopenharmony_ci */ 225761847f8eSopenharmony_ci readArrayBuffer(typeCode: TypeCode): ArrayBuffer; 225861847f8eSopenharmony_ci } 225961847f8eSopenharmony_ci 226061847f8eSopenharmony_ci /** 226161847f8eSopenharmony_ci * @typedef Sequenceable 226261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 226361847f8eSopenharmony_ci * @since 7 226461847f8eSopenharmony_ci * @deprecated since 9 226561847f8eSopenharmony_ci * @useinstead ohos.rpc.Parcelable 226661847f8eSopenharmony_ci */ 226761847f8eSopenharmony_ci interface Sequenceable { 226861847f8eSopenharmony_ci /** 226961847f8eSopenharmony_ci * Marshal this {@code Sequenceable} object into a {@link MessageParcel}. 227061847f8eSopenharmony_ci * 227161847f8eSopenharmony_ci * @param { MessageParcel } dataOut - Indicates the {@link MessageParcel} object to which the {@code Sequenceable} 227261847f8eSopenharmony_ci * object will be marshalled. 227361847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the marshalling is successful; return {@code false} otherwise. 227461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 227561847f8eSopenharmony_ci * @since 7 227661847f8eSopenharmony_ci * @deprecated since 9 227761847f8eSopenharmony_ci */ 227861847f8eSopenharmony_ci marshalling(dataOut: MessageParcel): boolean; 227961847f8eSopenharmony_ci 228061847f8eSopenharmony_ci /** 228161847f8eSopenharmony_ci * Unmarshal this {@code Sequenceable} object from a {@link MessageParcel}. 228261847f8eSopenharmony_ci * 228361847f8eSopenharmony_ci * @param { MessageParcel } dataIn - Indicates the {@link MessageParcel} object into which the {@code Sequenceable} 228461847f8eSopenharmony_ci * object has been marshalled. 228561847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the unmarshalling is successful; return {@code false} otherwise. 228661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 228761847f8eSopenharmony_ci * @since 7 228861847f8eSopenharmony_ci * @deprecated since 9 228961847f8eSopenharmony_ci */ 229061847f8eSopenharmony_ci unmarshalling(dataIn: MessageParcel): boolean; 229161847f8eSopenharmony_ci } 229261847f8eSopenharmony_ci 229361847f8eSopenharmony_ci /** 229461847f8eSopenharmony_ci * @typedef Parcelable 229561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 229661847f8eSopenharmony_ci * @since 9 229761847f8eSopenharmony_ci */ 229861847f8eSopenharmony_ci /** 229961847f8eSopenharmony_ci * During inter-process communication, objects of the class are written to the {@link MessageSequence} and 230061847f8eSopenharmony_ci * they are recovered from the {@link MessageSequence}. 230161847f8eSopenharmony_ci * 230261847f8eSopenharmony_ci * @typedef Parcelable 230361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 230461847f8eSopenharmony_ci * @since 11 230561847f8eSopenharmony_ci */ 230661847f8eSopenharmony_ci interface Parcelable { 230761847f8eSopenharmony_ci /** 230861847f8eSopenharmony_ci * Marshal this {@code Parcelable} object into a {@link MessageSequence}. 230961847f8eSopenharmony_ci * 231061847f8eSopenharmony_ci * @param { MessageSequence } dataOut - Indicates the {@link MessageSequence} object to which the {@code Parcelable} 231161847f8eSopenharmony_ci * object will be marshalled. 231261847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the marshalling is successful; return {@code false} otherwise. 231361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 231461847f8eSopenharmony_ci * @since 9 231561847f8eSopenharmony_ci */ 231661847f8eSopenharmony_ci marshalling(dataOut: MessageSequence): boolean; 231761847f8eSopenharmony_ci 231861847f8eSopenharmony_ci /** 231961847f8eSopenharmony_ci * Unmarshal this {@code Parcelable} object from a {@link MessageSequence}. 232061847f8eSopenharmony_ci * 232161847f8eSopenharmony_ci * @param { MessageSequence } dataIn - Indicates the {@link MessageSequence} object into 232261847f8eSopenharmony_ci * which the {@code Parcelable} object has been marshalled. 232361847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the unmarshalling is successful; return {@code false} otherwise. 232461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 232561847f8eSopenharmony_ci * @since 9 232661847f8eSopenharmony_ci */ 232761847f8eSopenharmony_ci unmarshalling(dataIn: MessageSequence): boolean; 232861847f8eSopenharmony_ci } 232961847f8eSopenharmony_ci 233061847f8eSopenharmony_ci /** 233161847f8eSopenharmony_ci * Defines the response to the request. 233261847f8eSopenharmony_ci * <p> SendRequestResult object contains four members, namely error code of this operation, request code, data parcel 233361847f8eSopenharmony_ci * and reply parcel. 233461847f8eSopenharmony_ci * 233561847f8eSopenharmony_ci * @typedef SendRequestResult 233661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 233761847f8eSopenharmony_ci * @since 8 233861847f8eSopenharmony_ci * @deprecated since 9 233961847f8eSopenharmony_ci * @useinstead ohos.rpc.RequestResult 234061847f8eSopenharmony_ci */ 234161847f8eSopenharmony_ci interface SendRequestResult { 234261847f8eSopenharmony_ci /** 234361847f8eSopenharmony_ci * Error code. 0 indicates successful, otherwise it is failed. 234461847f8eSopenharmony_ci * 234561847f8eSopenharmony_ci * @type { number } 234661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 234761847f8eSopenharmony_ci * @since 8 234861847f8eSopenharmony_ci * @deprecated since 9 234961847f8eSopenharmony_ci */ 235061847f8eSopenharmony_ci errCode: number; 235161847f8eSopenharmony_ci 235261847f8eSopenharmony_ci /** 235361847f8eSopenharmony_ci * Message code. It is same as the code in {@link SendRequest} method. 235461847f8eSopenharmony_ci * 235561847f8eSopenharmony_ci * @type { number } 235661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 235761847f8eSopenharmony_ci * @since 8 235861847f8eSopenharmony_ci * @deprecated since 9 235961847f8eSopenharmony_ci */ 236061847f8eSopenharmony_ci code: number; 236161847f8eSopenharmony_ci 236261847f8eSopenharmony_ci /** 236361847f8eSopenharmony_ci * MessageParcel object sent to the peer process. 236461847f8eSopenharmony_ci * It is the same object in {@link SendRequest} method. 236561847f8eSopenharmony_ci * 236661847f8eSopenharmony_ci * @type { MessageParcel } 236761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 236861847f8eSopenharmony_ci * @since 8 236961847f8eSopenharmony_ci * @deprecated since 9 237061847f8eSopenharmony_ci */ 237161847f8eSopenharmony_ci data: MessageParcel; 237261847f8eSopenharmony_ci 237361847f8eSopenharmony_ci /** 237461847f8eSopenharmony_ci * MessageParcel object returned by the peer process. 237561847f8eSopenharmony_ci * It is the same object in {@link SendRequest} method. 237661847f8eSopenharmony_ci * 237761847f8eSopenharmony_ci * @type { MessageParcel } 237861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 237961847f8eSopenharmony_ci * @since 8 238061847f8eSopenharmony_ci * @deprecated since 9 238161847f8eSopenharmony_ci */ 238261847f8eSopenharmony_ci reply: MessageParcel; 238361847f8eSopenharmony_ci } 238461847f8eSopenharmony_ci 238561847f8eSopenharmony_ci /** 238661847f8eSopenharmony_ci * Defines the response to the request. 238761847f8eSopenharmony_ci * <p> SendRequestResult object contains four members, namely error code of this operation, request code, data parcel 238861847f8eSopenharmony_ci * and reply parcel. 238961847f8eSopenharmony_ci * 239061847f8eSopenharmony_ci * @typedef RequestResult 239161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 239261847f8eSopenharmony_ci * @since 9 239361847f8eSopenharmony_ci */ 239461847f8eSopenharmony_ci interface RequestResult { 239561847f8eSopenharmony_ci /** 239661847f8eSopenharmony_ci * Error code. 0 indicates successful, otherwise it is failed. 239761847f8eSopenharmony_ci * 239861847f8eSopenharmony_ci * @type { number } 239961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 240061847f8eSopenharmony_ci * @since 9 240161847f8eSopenharmony_ci */ 240261847f8eSopenharmony_ci errCode: number; 240361847f8eSopenharmony_ci 240461847f8eSopenharmony_ci /** 240561847f8eSopenharmony_ci * Message code. It is same as the code in {@link SendRequest} method. 240661847f8eSopenharmony_ci * 240761847f8eSopenharmony_ci * @type { number } 240861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 240961847f8eSopenharmony_ci * @since 9 241061847f8eSopenharmony_ci */ 241161847f8eSopenharmony_ci code: number; 241261847f8eSopenharmony_ci 241361847f8eSopenharmony_ci /** 241461847f8eSopenharmony_ci * MessageSequence object sent to the peer process. 241561847f8eSopenharmony_ci * It is the same object in {@link SendRequest} method. 241661847f8eSopenharmony_ci * 241761847f8eSopenharmony_ci * @type { MessageSequence } 241861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 241961847f8eSopenharmony_ci * @since 9 242061847f8eSopenharmony_ci */ 242161847f8eSopenharmony_ci data: MessageSequence; 242261847f8eSopenharmony_ci 242361847f8eSopenharmony_ci /** 242461847f8eSopenharmony_ci * MessageSequence object returned by the peer process. 242561847f8eSopenharmony_ci * It is the same object in {@link SendRequest} method. 242661847f8eSopenharmony_ci * 242761847f8eSopenharmony_ci * @type { MessageSequence } 242861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 242961847f8eSopenharmony_ci * @since 9 243061847f8eSopenharmony_ci */ 243161847f8eSopenharmony_ci reply: MessageSequence; 243261847f8eSopenharmony_ci } 243361847f8eSopenharmony_ci 243461847f8eSopenharmony_ci /** 243561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 243661847f8eSopenharmony_ci * @since 7 243761847f8eSopenharmony_ci */ 243861847f8eSopenharmony_ci /** 243961847f8eSopenharmony_ci * Used to query or get interface descriptors, add or remove death notifications, dump object status to 244061847f8eSopenharmony_ci * a specific file, and send messages. 244161847f8eSopenharmony_ci * 244261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 244361847f8eSopenharmony_ci * @since 11 244461847f8eSopenharmony_ci */ 244561847f8eSopenharmony_ci abstract class IRemoteObject { 244661847f8eSopenharmony_ci /** 244761847f8eSopenharmony_ci * Queries the description of an interface. 244861847f8eSopenharmony_ci * <p>A valid {@link IRemoteBroker} object is returned for an interface used by the service provider; 244961847f8eSopenharmony_ci * {@code null} is returned for an interface used by the service user, 245061847f8eSopenharmony_ci * indicating that the interface is not a local one. 245161847f8eSopenharmony_ci * 245261847f8eSopenharmony_ci * @param { string } descriptor - Indicates the interface descriptor. 245361847f8eSopenharmony_ci * @returns { IRemoteBroker } Return the {@link IRemoteBroker} object bound to the specified interface descriptor. 245461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 245561847f8eSopenharmony_ci * @since 7 245661847f8eSopenharmony_ci * @deprecated since 9 245761847f8eSopenharmony_ci * @useinstead ohos.rpc.IRemoteObject#getLocalInterface 245861847f8eSopenharmony_ci */ 245961847f8eSopenharmony_ci queryLocalInterface(descriptor: string): IRemoteBroker; 246061847f8eSopenharmony_ci 246161847f8eSopenharmony_ci /** 246261847f8eSopenharmony_ci * Queries the description of an interface. 246361847f8eSopenharmony_ci * <p>A valid {@link IRemoteBroker} object is returned for an interface used by the service provider; 246461847f8eSopenharmony_ci * {@code null} is returned for an interface used by the service user, 246561847f8eSopenharmony_ci * indicating that the interface is not a local one. 246661847f8eSopenharmony_ci * 246761847f8eSopenharmony_ci * @param { string } descriptor - Indicates the interface descriptor. 246861847f8eSopenharmony_ci * @returns { IRemoteBroker } Return the {@link IRemoteBroker} object bound to the specified interface descriptor. 246961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 247061847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 247161847f8eSopenharmony_ci * 2.The parameter type does not match; 247261847f8eSopenharmony_ci * 3.The string length exceeds 40960 bytes; 247361847f8eSopenharmony_ci * 4.The number of bytes copied to the buffer is different from the length of the obtained string. 247461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 247561847f8eSopenharmony_ci * @since 9 247661847f8eSopenharmony_ci */ 247761847f8eSopenharmony_ci getLocalInterface(descriptor: string): IRemoteBroker; 247861847f8eSopenharmony_ci 247961847f8eSopenharmony_ci /** 248061847f8eSopenharmony_ci * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. 248161847f8eSopenharmony_ci * <p>If asynchronous mode is set for {@code option}, a response is returned immediately. 248261847f8eSopenharmony_ci * If synchronous mode is set for {@code option}, the interface will wait for a response from the peer process 248361847f8eSopenharmony_ci * until the request times out. The user must prepare {@code reply} for receiving the execution result 248461847f8eSopenharmony_ci * given by the peer process. 248561847f8eSopenharmony_ci * 248661847f8eSopenharmony_ci * @param { number } code - Indicates the message code, which is determined by both sides of the communication. 248761847f8eSopenharmony_ci * If the interface is generated by the IDL tool, the message code is automatically generated by IDL. 248861847f8eSopenharmony_ci * @param { MessageParcel } data - Indicates the {@link MessageParcel} object sent to the peer process. 248961847f8eSopenharmony_ci * @param { MessageParcel } reply - Indicates the {@link MessageParcel} object returned by the peer process. 249061847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 249161847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the method is called successfully; return {@code false} otherwise. 249261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 249361847f8eSopenharmony_ci * @since 7 249461847f8eSopenharmony_ci * @deprecated since 9 249561847f8eSopenharmony_ci */ 249661847f8eSopenharmony_ci sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; 249761847f8eSopenharmony_ci 249861847f8eSopenharmony_ci /** 249961847f8eSopenharmony_ci * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. 250061847f8eSopenharmony_ci * <p>If options indicates the asynchronous mode, a promise will be fulfilled immediately 250161847f8eSopenharmony_ci * and the reply message does not contain any content. If options indicates the synchronous mode, 250261847f8eSopenharmony_ci * a promise will be fulfilled when the response to sendRequest is returned, 250361847f8eSopenharmony_ci * and the reply message contains the returned information. 250461847f8eSopenharmony_ci * 250561847f8eSopenharmony_ci * @param { number } code - Message code called by the request, which is determined by the client and server. 250661847f8eSopenharmony_ci * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. 250761847f8eSopenharmony_ci * @param { MessageParcel } data - {@link MessageParcel} object holding the data to send. 250861847f8eSopenharmony_ci * @param { MessageParcel } reply - {@link MessageParcel} object that receives the response. 250961847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 251061847f8eSopenharmony_ci * @returns { Promise<SendRequestResult> } Promise used to return the {@link SendRequestResult} instance. 251161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 251261847f8eSopenharmony_ci * @since 8 251361847f8eSopenharmony_ci * @deprecated since 9 251461847f8eSopenharmony_ci * @useinstead ohos.rpc.IRemoteObject#sendMessageRequest 251561847f8eSopenharmony_ci */ 251661847f8eSopenharmony_ci sendRequest( 251761847f8eSopenharmony_ci code: number, 251861847f8eSopenharmony_ci data: MessageParcel, 251961847f8eSopenharmony_ci reply: MessageParcel, 252061847f8eSopenharmony_ci options: MessageOption 252161847f8eSopenharmony_ci ): Promise<SendRequestResult>; 252261847f8eSopenharmony_ci 252361847f8eSopenharmony_ci /** 252461847f8eSopenharmony_ci * Sends a {@link MessageSequence} message to the peer process asynchronously. 252561847f8eSopenharmony_ci * <p>If options indicates the asynchronous mode, a promise will be fulfilled immediately 252661847f8eSopenharmony_ci * and the reply message does not contain any content. If options indicates the synchronous mode, 252761847f8eSopenharmony_ci * a promise will be fulfilled when the response to sendMessageRequest is returned, 252861847f8eSopenharmony_ci * and the reply message contains the returned information. 252961847f8eSopenharmony_ci * 253061847f8eSopenharmony_ci * @param { number } code - Message code called by the request, which is determined by the client and server. 253161847f8eSopenharmony_ci * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. 253261847f8eSopenharmony_ci * @param {MessageSequence } data - {@link MessageSequence} object holding the data to send. 253361847f8eSopenharmony_ci * @param {MessageSequence } reply - {@link MessageSequence} object that receives the response. 253461847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 253561847f8eSopenharmony_ci * @returns { Promise<RequestResult> } Promise used to return the {@link RequestResult} instance. 253661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 253761847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 253861847f8eSopenharmony_ci * 2.The parameter type does not match; 253961847f8eSopenharmony_ci * 3.Failed to obtain the passed object instance. 254061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 254161847f8eSopenharmony_ci * @since 9 254261847f8eSopenharmony_ci */ 254361847f8eSopenharmony_ci sendMessageRequest( 254461847f8eSopenharmony_ci code: number, 254561847f8eSopenharmony_ci data: MessageSequence, 254661847f8eSopenharmony_ci reply: MessageSequence, 254761847f8eSopenharmony_ci options: MessageOption 254861847f8eSopenharmony_ci ): Promise<RequestResult>; 254961847f8eSopenharmony_ci 255061847f8eSopenharmony_ci /** 255161847f8eSopenharmony_ci * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. 255261847f8eSopenharmony_ci * <p>If options indicates the asynchronous mode, a callback will be invoked immediately 255361847f8eSopenharmony_ci * and the reply message does not contain any content. If options indicates the synchronous mode, 255461847f8eSopenharmony_ci * a callback will be invoked when the response to sendRequest is returned, 255561847f8eSopenharmony_ci * and the reply message contains the returned information. 255661847f8eSopenharmony_ci * 255761847f8eSopenharmony_ci * @param { number } code - Message code called by the request, which is determined by the client and server. 255861847f8eSopenharmony_ci * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. 255961847f8eSopenharmony_ci * @param { MessageParcel } data - {@link MessageParcel} object holding the data to send. 256061847f8eSopenharmony_ci * @param { MessageParcel } reply - {@link MessageParcel} object that receives the response. 256161847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 256261847f8eSopenharmony_ci * @param { AsyncCallback<SendRequestResult> } callback - Callback for receiving the sending result. 256361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 256461847f8eSopenharmony_ci * @since 8 256561847f8eSopenharmony_ci * @deprecated since 9 256661847f8eSopenharmony_ci * @useinstead ohos.rpc.IRemoteObject#sendMessageRequest 256761847f8eSopenharmony_ci */ 256861847f8eSopenharmony_ci sendRequest( 256961847f8eSopenharmony_ci code: number, 257061847f8eSopenharmony_ci data: MessageParcel, 257161847f8eSopenharmony_ci reply: MessageParcel, 257261847f8eSopenharmony_ci options: MessageOption, 257361847f8eSopenharmony_ci callback: AsyncCallback<SendRequestResult> 257461847f8eSopenharmony_ci ): void; 257561847f8eSopenharmony_ci 257661847f8eSopenharmony_ci /** 257761847f8eSopenharmony_ci * Sends a {@link MessageSequence} message to the peer process in synchronous or asynchronous mode. 257861847f8eSopenharmony_ci * <p>If options indicates the asynchronous mode, a callback will be invoked immediately 257961847f8eSopenharmony_ci * and the reply message does not contain any content. If options indicates the synchronous mode, 258061847f8eSopenharmony_ci * a callback will be invoked when the response to sendMessageRequest is returned, 258161847f8eSopenharmony_ci * and the reply message contains the returned information. 258261847f8eSopenharmony_ci * 258361847f8eSopenharmony_ci * @param {number } code - Message code called by the request, which is determined by the client and server. 258461847f8eSopenharmony_ci * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. 258561847f8eSopenharmony_ci * @param { MessageSequence } data - {@link MessageSequence} object holding the data to send. 258661847f8eSopenharmony_ci * @param { MessageSequence } reply - {@link MessageSequence} object that receives the response. 258761847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 258861847f8eSopenharmony_ci * @param { AsyncCallback<RequestResult> } callback - Callback for receiving the sending result. 258961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 259061847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 259161847f8eSopenharmony_ci * 2.The parameter type does not match; 259261847f8eSopenharmony_ci * 3.Failed to obtain the passed object instance. 259361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 259461847f8eSopenharmony_ci * @since 9 259561847f8eSopenharmony_ci */ 259661847f8eSopenharmony_ci sendMessageRequest( 259761847f8eSopenharmony_ci code: number, 259861847f8eSopenharmony_ci data: MessageSequence, 259961847f8eSopenharmony_ci reply: MessageSequence, 260061847f8eSopenharmony_ci options: MessageOption, 260161847f8eSopenharmony_ci callback: AsyncCallback<RequestResult> 260261847f8eSopenharmony_ci ): void; 260361847f8eSopenharmony_ci 260461847f8eSopenharmony_ci /** 260561847f8eSopenharmony_ci * Register a callback used to receive notifications of the death of a remote object. 260661847f8eSopenharmony_ci * 260761847f8eSopenharmony_ci * @param { DeathRecipient } recipient - Indicates the callback to be registered. 260861847f8eSopenharmony_ci * @param { number } flags - Indicates the flag of the death notification. 260961847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the callback is registered successfully; 261061847f8eSopenharmony_ci * return {@code false} otherwise. 261161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 261261847f8eSopenharmony_ci * @since 7 261361847f8eSopenharmony_ci * @deprecated since 9 261461847f8eSopenharmony_ci * @useinstead ohos.rpc.IRemoteObject#registerDeathRecipient 261561847f8eSopenharmony_ci */ 261661847f8eSopenharmony_ci addDeathRecipient(recipient: DeathRecipient, flags: number): boolean; 261761847f8eSopenharmony_ci 261861847f8eSopenharmony_ci /** 261961847f8eSopenharmony_ci * Register a callback used to receive notifications of the death of a remote object. 262061847f8eSopenharmony_ci * 262161847f8eSopenharmony_ci * @param { DeathRecipient } recipient - Indicates the callback to be registered. 262261847f8eSopenharmony_ci * @param { number } flags - Indicates the flag of the death notification. 262361847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 262461847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 262561847f8eSopenharmony_ci * 2.The parameter type does not match; 262661847f8eSopenharmony_ci * 3.The callback used to receive remote object death notifications is empty. 262761847f8eSopenharmony_ci * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. 262861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 262961847f8eSopenharmony_ci * @since 9 263061847f8eSopenharmony_ci */ 263161847f8eSopenharmony_ci registerDeathRecipient(recipient: DeathRecipient, flags: number): void; 263261847f8eSopenharmony_ci 263361847f8eSopenharmony_ci /** 263461847f8eSopenharmony_ci * Unregister a callback used to receive notifications of the death of a remote object. 263561847f8eSopenharmony_ci * 263661847f8eSopenharmony_ci * @param { DeathRecipient } recipient - Indicates the callback to be unregister. 263761847f8eSopenharmony_ci * @param { number } flags - Indicates the flag of the death notification. 263861847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the callback is unregister successfully; 263961847f8eSopenharmony_ci * return {@code false} otherwise. 264061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 264161847f8eSopenharmony_ci * @since 7 264261847f8eSopenharmony_ci * @deprecated since 9 264361847f8eSopenharmony_ci * @useinstead ohos.rpc.IRemoteObject#unregisterDeathRecipient 264461847f8eSopenharmony_ci */ 264561847f8eSopenharmony_ci removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean; 264661847f8eSopenharmony_ci 264761847f8eSopenharmony_ci /** 264861847f8eSopenharmony_ci * Unregister a callback used to receive notifications of the death of a remote object. 264961847f8eSopenharmony_ci * 265061847f8eSopenharmony_ci * @param { DeathRecipient } recipient - Indicates the callback to be unregister. 265161847f8eSopenharmony_ci * @param { number } flags - Indicates the flag of the death notification. 265261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 265361847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 265461847f8eSopenharmony_ci * 2.The parameter type does not match; 265561847f8eSopenharmony_ci * 3.The callback used to receive remote object death notifications is empty. 265661847f8eSopenharmony_ci * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. 265761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 265861847f8eSopenharmony_ci * @since 9 265961847f8eSopenharmony_ci */ 266061847f8eSopenharmony_ci unregisterDeathRecipient(recipient: DeathRecipient, flags: number): void; 266161847f8eSopenharmony_ci 266261847f8eSopenharmony_ci /** 266361847f8eSopenharmony_ci * Obtains the interface descriptor of an object. 266461847f8eSopenharmony_ci * <p>The interface descriptor is a character string. 266561847f8eSopenharmony_ci * 266661847f8eSopenharmony_ci * @returns { string } Return the interface descriptor. 266761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 266861847f8eSopenharmony_ci * @since 7 266961847f8eSopenharmony_ci * @deprecated since 9 267061847f8eSopenharmony_ci * @useinstead ohos.rpc.IRemoteObject#getDescriptor 267161847f8eSopenharmony_ci */ 267261847f8eSopenharmony_ci getInterfaceDescriptor(): string; 267361847f8eSopenharmony_ci 267461847f8eSopenharmony_ci /** 267561847f8eSopenharmony_ci * Obtains the interface descriptor of an object. 267661847f8eSopenharmony_ci * <p>The interface descriptor is a character string. 267761847f8eSopenharmony_ci * 267861847f8eSopenharmony_ci * @returns { string } Return the interface descriptor. 267961847f8eSopenharmony_ci * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. 268061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 268161847f8eSopenharmony_ci * @since 9 268261847f8eSopenharmony_ci */ 268361847f8eSopenharmony_ci getDescriptor(): string; 268461847f8eSopenharmony_ci 268561847f8eSopenharmony_ci /** 268661847f8eSopenharmony_ci * Checks whether an object is dead. 268761847f8eSopenharmony_ci * 268861847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the object is dead; return {@code false} otherwise. 268961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 269061847f8eSopenharmony_ci * @since 7 269161847f8eSopenharmony_ci */ 269261847f8eSopenharmony_ci isObjectDead(): boolean; 269361847f8eSopenharmony_ci } 269461847f8eSopenharmony_ci 269561847f8eSopenharmony_ci /** 269661847f8eSopenharmony_ci * @typedef IRemoteBroker 269761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 269861847f8eSopenharmony_ci * @since 7 269961847f8eSopenharmony_ci */ 270061847f8eSopenharmony_ci /** 270161847f8eSopenharmony_ci * Used to define the communication interface of the IPC communication objects. 270261847f8eSopenharmony_ci * 270361847f8eSopenharmony_ci * @typedef IRemoteBroker 270461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 270561847f8eSopenharmony_ci * @since 11 270661847f8eSopenharmony_ci */ 270761847f8eSopenharmony_ci interface IRemoteBroker { 270861847f8eSopenharmony_ci /** 270961847f8eSopenharmony_ci * Obtains a proxy or remote object. This method must be implemented by its derived classes. 271061847f8eSopenharmony_ci * 271161847f8eSopenharmony_ci * @returns { IRemoteObject } Return the RemoteObject if the caller is a RemoteObject; return the IRemoteObject, 271261847f8eSopenharmony_ci * that is, the holder of this RemoteProxy object, if the caller is a RemoteProxy object. 271361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 271461847f8eSopenharmony_ci * @since 7 271561847f8eSopenharmony_ci */ 271661847f8eSopenharmony_ci asObject(): IRemoteObject; 271761847f8eSopenharmony_ci } 271861847f8eSopenharmony_ci 271961847f8eSopenharmony_ci /** 272061847f8eSopenharmony_ci * @typedef DeathRecipient 272161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 272261847f8eSopenharmony_ci * @since 7 272361847f8eSopenharmony_ci */ 272461847f8eSopenharmony_ci /** 272561847f8eSopenharmony_ci * Used to subscribe to death notifications for remote objects. 272661847f8eSopenharmony_ci * <p> 272761847f8eSopenharmony_ci * When a remote object subscribed to the notification dies, the local end can receive a message and call 272861847f8eSopenharmony_ci * the onRemoteDied operation. The death of a remote object can be caused by the death of the process to which the 272961847f8eSopenharmony_ci * remote object belongs, the shutdown or restart of the device to which the remote object belongs, 273061847f8eSopenharmony_ci * or the death of the remote object when the remote object and the local object belong to different devices, 273161847f8eSopenharmony_ci * and when the remote object leaves the network. 273261847f8eSopenharmony_ci * </p> 273361847f8eSopenharmony_ci * 273461847f8eSopenharmony_ci * @typedef DeathRecipient 273561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 273661847f8eSopenharmony_ci * @since 11 273761847f8eSopenharmony_ci */ 273861847f8eSopenharmony_ci interface DeathRecipient { 273961847f8eSopenharmony_ci /** 274061847f8eSopenharmony_ci * Called to perform subsequent operations when a death notification of the remote object is received. 274161847f8eSopenharmony_ci * 274261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 274361847f8eSopenharmony_ci * @since 7 274461847f8eSopenharmony_ci */ 274561847f8eSopenharmony_ci onRemoteDied(): void; 274661847f8eSopenharmony_ci } 274761847f8eSopenharmony_ci 274861847f8eSopenharmony_ci /** 274961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 275061847f8eSopenharmony_ci * @since 7 275161847f8eSopenharmony_ci */ 275261847f8eSopenharmony_ci /** 275361847f8eSopenharmony_ci * Public Message Option, using the specified flag type, constructs the specified MessageOption object. 275461847f8eSopenharmony_ci * 275561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 275661847f8eSopenharmony_ci * @since 11 275761847f8eSopenharmony_ci */ 275861847f8eSopenharmony_ci class MessageOption { 275961847f8eSopenharmony_ci /** 276061847f8eSopenharmony_ci * Indicates synchronous call. 276161847f8eSopenharmony_ci * 276261847f8eSopenharmony_ci * @type { number } 276361847f8eSopenharmony_ci * @default 0 276461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 276561847f8eSopenharmony_ci * @since 7 276661847f8eSopenharmony_ci */ 276761847f8eSopenharmony_ci TF_SYNC: number; 276861847f8eSopenharmony_ci 276961847f8eSopenharmony_ci /** 277061847f8eSopenharmony_ci * Indicates asynchronous call. 277161847f8eSopenharmony_ci * 277261847f8eSopenharmony_ci * @type { number } 277361847f8eSopenharmony_ci * @default 1 277461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 277561847f8eSopenharmony_ci * @since 7 277661847f8eSopenharmony_ci */ 277761847f8eSopenharmony_ci TF_ASYNC: number; 277861847f8eSopenharmony_ci 277961847f8eSopenharmony_ci /** 278061847f8eSopenharmony_ci * Indicates the sendRequest API for returning the file descriptor. 278161847f8eSopenharmony_ci * 278261847f8eSopenharmony_ci * @type { number } 278361847f8eSopenharmony_ci * @default 16 278461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 278561847f8eSopenharmony_ci * @since 7 278661847f8eSopenharmony_ci */ 278761847f8eSopenharmony_ci TF_ACCEPT_FDS: number; 278861847f8eSopenharmony_ci 278961847f8eSopenharmony_ci /** 279061847f8eSopenharmony_ci * Indicates the wait time for RPC, in seconds. It is NOT used in IPC case. 279161847f8eSopenharmony_ci * 279261847f8eSopenharmony_ci * @default 4 279361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 279461847f8eSopenharmony_ci * @since 7 279561847f8eSopenharmony_ci */ 279661847f8eSopenharmony_ci /** 279761847f8eSopenharmony_ci * Indicates the wait time for RPC, in seconds. It is NOT used in IPC case. 279861847f8eSopenharmony_ci * 279961847f8eSopenharmony_ci * @type { number } 280061847f8eSopenharmony_ci * @default 8 280161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 280261847f8eSopenharmony_ci * @since 11 280361847f8eSopenharmony_ci */ 280461847f8eSopenharmony_ci TF_WAIT_TIME: number; 280561847f8eSopenharmony_ci 280661847f8eSopenharmony_ci /** 280761847f8eSopenharmony_ci * A constructor used to create a MessageOption instance. 280861847f8eSopenharmony_ci * 280961847f8eSopenharmony_ci * @param { number } syncFlags - Specifies whether the SendRequest is called synchronously (default) or asynchronously. 281061847f8eSopenharmony_ci * @param { number } waitTime - Maximum wait time for a RPC call. The default value is TF_WAIT_TIME. 281161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 281261847f8eSopenharmony_ci * @since 7 281361847f8eSopenharmony_ci */ 281461847f8eSopenharmony_ci constructor(syncFlags?: number, waitTime?: number); 281561847f8eSopenharmony_ci 281661847f8eSopenharmony_ci /** 281761847f8eSopenharmony_ci * A constructor used to create a MessageOption instance. 281861847f8eSopenharmony_ci * 281961847f8eSopenharmony_ci * @param { boolean } async - Specifies whether the SendRequest is called synchronously (default) or asynchronously. 282061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 282161847f8eSopenharmony_ci * @since 9 282261847f8eSopenharmony_ci */ 282361847f8eSopenharmony_ci constructor(async?: boolean); 282461847f8eSopenharmony_ci 282561847f8eSopenharmony_ci /** 282661847f8eSopenharmony_ci * Obtains the SendRequest call flag, which can be synchronous or asynchronous. 282761847f8eSopenharmony_ci * 282861847f8eSopenharmony_ci * @returns { number } Return whether the SendRequest is called synchronously or asynchronously. 282961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 283061847f8eSopenharmony_ci * @since 7 283161847f8eSopenharmony_ci */ 283261847f8eSopenharmony_ci getFlags(): number; 283361847f8eSopenharmony_ci 283461847f8eSopenharmony_ci /** 283561847f8eSopenharmony_ci * Sets the SendRequest call flag, which can be synchronous or asynchronous. 283661847f8eSopenharmony_ci * 283761847f8eSopenharmony_ci * @param { number } flags - Indicates the call flag, which can be synchronous or asynchronous. 283861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 283961847f8eSopenharmony_ci * @since 7 284061847f8eSopenharmony_ci */ 284161847f8eSopenharmony_ci setFlags(flags: number): void; 284261847f8eSopenharmony_ci 284361847f8eSopenharmony_ci /** 284461847f8eSopenharmony_ci * Obtains the SendRequest call flag, which can be synchronous or asynchronous. 284561847f8eSopenharmony_ci * 284661847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the asynchronous call succeeds; 284761847f8eSopenharmony_ci * return {@code false} if the synchronous call succeeds. 284861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 284961847f8eSopenharmony_ci * @since 9 285061847f8eSopenharmony_ci */ 285161847f8eSopenharmony_ci isAsync(): boolean; 285261847f8eSopenharmony_ci 285361847f8eSopenharmony_ci /** 285461847f8eSopenharmony_ci * Sets the SendRequest call flag, which can be synchronous or asynchronous. 285561847f8eSopenharmony_ci * 285661847f8eSopenharmony_ci * @param { boolean } async - Indicates the call flag, which can be synchronous or asynchronous. 285761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 285861847f8eSopenharmony_ci * @since 9 285961847f8eSopenharmony_ci */ 286061847f8eSopenharmony_ci setAsync(async: boolean): void; 286161847f8eSopenharmony_ci 286261847f8eSopenharmony_ci /** 286361847f8eSopenharmony_ci * Obtains the maximum wait time for this RPC call. 286461847f8eSopenharmony_ci * 286561847f8eSopenharmony_ci * @returns { number } Return maximum wait time obtained. 286661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 286761847f8eSopenharmony_ci * @since 7 286861847f8eSopenharmony_ci */ 286961847f8eSopenharmony_ci getWaitTime(): number; 287061847f8eSopenharmony_ci 287161847f8eSopenharmony_ci /** 287261847f8eSopenharmony_ci * Sets the maximum wait time for this RPC call. 287361847f8eSopenharmony_ci * 287461847f8eSopenharmony_ci * @param { number } waitTime - Indicates maximum wait time to set. 287561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 287661847f8eSopenharmony_ci * @since 7 287761847f8eSopenharmony_ci */ 287861847f8eSopenharmony_ci setWaitTime(waitTime: number): void; 287961847f8eSopenharmony_ci } 288061847f8eSopenharmony_ci 288161847f8eSopenharmony_ci /** 288261847f8eSopenharmony_ci * @extends IRemoteObject 288361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 288461847f8eSopenharmony_ci * @since 7 288561847f8eSopenharmony_ci */ 288661847f8eSopenharmony_ci /** 288761847f8eSopenharmony_ci * Implement remote objects. The service provider must inherit this class. 288861847f8eSopenharmony_ci * 288961847f8eSopenharmony_ci * @extends IRemoteObject 289061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 289161847f8eSopenharmony_ci * @since 11 289261847f8eSopenharmony_ci */ 289361847f8eSopenharmony_ci class RemoteObject extends IRemoteObject { 289461847f8eSopenharmony_ci /** 289561847f8eSopenharmony_ci * A constructor to create a RemoteObject instance. 289661847f8eSopenharmony_ci * 289761847f8eSopenharmony_ci * @param { string } descriptor - Specifies interface descriptor. 289861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 289961847f8eSopenharmony_ci * @since 7 290061847f8eSopenharmony_ci */ 290161847f8eSopenharmony_ci constructor(descriptor: string); 290261847f8eSopenharmony_ci 290361847f8eSopenharmony_ci /** 290461847f8eSopenharmony_ci * Queries a remote object using an interface descriptor. 290561847f8eSopenharmony_ci * 290661847f8eSopenharmony_ci * @param { string } descriptor - Indicates the interface descriptor used to query the remote object. 290761847f8eSopenharmony_ci * @returns { IRemoteBroker } Return the remote object matching the interface descriptor; 290861847f8eSopenharmony_ci * return null if no such remote object is found. 290961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 291061847f8eSopenharmony_ci * @since 7 291161847f8eSopenharmony_ci * @deprecated since 9 291261847f8eSopenharmony_ci * @useinstead ohos.rpc.RemoteObject#getLocalInterface 291361847f8eSopenharmony_ci */ 291461847f8eSopenharmony_ci queryLocalInterface(descriptor: string): IRemoteBroker; 291561847f8eSopenharmony_ci 291661847f8eSopenharmony_ci /** 291761847f8eSopenharmony_ci * Queries a remote object using an interface descriptor. 291861847f8eSopenharmony_ci * 291961847f8eSopenharmony_ci * @param { string } descriptor - Indicates the interface descriptor used to query the remote object. 292061847f8eSopenharmony_ci * @returns { IRemoteBroker } Return the remote object matching the interface descriptor; 292161847f8eSopenharmony_ci * return null if no such remote object is found. 292261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 292361847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 292461847f8eSopenharmony_ci * 2.The parameter type does not match; 292561847f8eSopenharmony_ci * 3.The string length exceeds 40960 bytes; 292661847f8eSopenharmony_ci * 4.The number of bytes copied to the buffer is different from the length of the obtained string. 292761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 292861847f8eSopenharmony_ci * @since 9 292961847f8eSopenharmony_ci */ 293061847f8eSopenharmony_ci getLocalInterface(descriptor: string): IRemoteBroker; 293161847f8eSopenharmony_ci 293261847f8eSopenharmony_ci /** 293361847f8eSopenharmony_ci * Queries an interface descriptor. 293461847f8eSopenharmony_ci * 293561847f8eSopenharmony_ci * @returns { string } Return the interface descriptor. 293661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 293761847f8eSopenharmony_ci * @since 7 293861847f8eSopenharmony_ci * @deprecated since 9 293961847f8eSopenharmony_ci * @useinstead ohos.rpc.RemoteObject#getDescriptor 294061847f8eSopenharmony_ci */ 294161847f8eSopenharmony_ci getInterfaceDescriptor(): string; 294261847f8eSopenharmony_ci 294361847f8eSopenharmony_ci /** 294461847f8eSopenharmony_ci * Queries an interface descriptor. 294561847f8eSopenharmony_ci * 294661847f8eSopenharmony_ci * @returns { string } Return the interface descriptor. 294761847f8eSopenharmony_ci * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. 294861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 294961847f8eSopenharmony_ci * @since 9 295061847f8eSopenharmony_ci */ 295161847f8eSopenharmony_ci getDescriptor(): string; 295261847f8eSopenharmony_ci 295361847f8eSopenharmony_ci /** 295461847f8eSopenharmony_ci * Sets an entry for receiving requests. 295561847f8eSopenharmony_ci * <p>This method is implemented by the remote service provider. You need to override this method with 295661847f8eSopenharmony_ci * your own service logic when you are using IPC. 295761847f8eSopenharmony_ci * 295861847f8eSopenharmony_ci * @param { number } code - Indicates the service request code sent from the peer end. 295961847f8eSopenharmony_ci * @param { MessageSequence } data - Indicates the {@link MessageParcel} object sent from the peer end. 296061847f8eSopenharmony_ci * @param { MessageSequence } reply - Indicates the response message object sent from the remote service. 296161847f8eSopenharmony_ci * The local service writes the response data to the {@link MessageParcel} object. 296261847f8eSopenharmony_ci * @param { MessageOption } options - Indicates whether the operation is synchronous or asynchronous. 296361847f8eSopenharmony_ci * @returns { boolean | Promise<boolean> } 296461847f8eSopenharmony_ci * Return a simple boolean which is {@code true} if the operation succeeds; 296561847f8eSopenharmony_ci * {{@code false} otherwise} when the function call is synchronous. 296661847f8eSopenharmony_ci * Return a promise object with a boolean when the function call is asynchronous. 296761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 296861847f8eSopenharmony_ci * @since 9 296961847f8eSopenharmony_ci */ 297061847f8eSopenharmony_ci onRemoteMessageRequest( 297161847f8eSopenharmony_ci code: number, 297261847f8eSopenharmony_ci data: MessageSequence, 297361847f8eSopenharmony_ci reply: MessageSequence, 297461847f8eSopenharmony_ci options: MessageOption 297561847f8eSopenharmony_ci ): boolean | Promise<boolean>; 297661847f8eSopenharmony_ci 297761847f8eSopenharmony_ci /** 297861847f8eSopenharmony_ci * Sets an entry for receiving requests. 297961847f8eSopenharmony_ci * <p>This method is implemented by the remote service provider. You need to override this method with 298061847f8eSopenharmony_ci * your own service logic when you are using IPC. 298161847f8eSopenharmony_ci * 298261847f8eSopenharmony_ci * @param { number } code - Indicates the service request code sent from the peer end. 298361847f8eSopenharmony_ci * @param { MessageParcel } data - Indicates the {@link MessageParcel} object sent from the peer end. 298461847f8eSopenharmony_ci * @param { MessageParcel } reply - Indicates the response message object sent from the remote service. 298561847f8eSopenharmony_ci * The local service writes the response data to the {@link MessageParcel} object. 298661847f8eSopenharmony_ci * @param { MessageOption } options - Indicates whether the operation is synchronous or asynchronous. 298761847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the operation succeeds; return {@code false} otherwise. 298861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 298961847f8eSopenharmony_ci * @since 7 299061847f8eSopenharmony_ci * @deprecated since 9 299161847f8eSopenharmony_ci * @useinstead ohos.rpc.RemoteObject#onRemoteMessageRequest 299261847f8eSopenharmony_ci */ 299361847f8eSopenharmony_ci onRemoteRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; 299461847f8eSopenharmony_ci 299561847f8eSopenharmony_ci /** 299661847f8eSopenharmony_ci * Sends a request to the peer object. 299761847f8eSopenharmony_ci * <p>If the peer object and {@code RemoteObject} are on the same device, the request is sent by the IPC driver. 299861847f8eSopenharmony_ci * If they are on different devices, the request is sent by the socket driver. 299961847f8eSopenharmony_ci * 300061847f8eSopenharmony_ci * @param { number } code - Indicates the message code of the request. 300161847f8eSopenharmony_ci * @param { MessageParcel } data - Indicates the {@link MessageParcel} object storing the data to be sent. 300261847f8eSopenharmony_ci * @param { MessageParcel } reply - Indicates the {@link MessageParcel} object receiving the response data. 300361847f8eSopenharmony_ci * @param { MessageOption } options - Indicates a synchronous (default) or asynchronous request. 300461847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the operation succeeds; return {@code false} otherwise. 300561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 300661847f8eSopenharmony_ci * @since 7 300761847f8eSopenharmony_ci * @deprecated since 8 300861847f8eSopenharmony_ci */ 300961847f8eSopenharmony_ci sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; 301061847f8eSopenharmony_ci 301161847f8eSopenharmony_ci /** 301261847f8eSopenharmony_ci * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. 301361847f8eSopenharmony_ci * <p>If options indicates the asynchronous mode, a promise will be fulfilled immediately 301461847f8eSopenharmony_ci * and the reply message does not contain any content. If options indicates the synchronous mode, 301561847f8eSopenharmony_ci * a promise will be fulfilled when the response to sendRequest is returned, 301661847f8eSopenharmony_ci * and the reply message contains the returned information. 301761847f8eSopenharmony_ci * 301861847f8eSopenharmony_ci * @param { number } code - Message code called by the request, which is determined by the client and server. 301961847f8eSopenharmony_ci * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. 302061847f8eSopenharmony_ci * @param { MessageParcel } data - {@link MessageParcel} object holding the data to send. 302161847f8eSopenharmony_ci * @param { MessageParcel } reply - {@link MessageParcel} object that receives the response. 302261847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 302361847f8eSopenharmony_ci * @returns { Promise<SendRequestResult> } Promise used to return the {@link SendRequestResult} instance. 302461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 302561847f8eSopenharmony_ci * @since 8 302661847f8eSopenharmony_ci * @deprecated since 9 302761847f8eSopenharmony_ci * @useinstead ohos.rpc.RemoteObject#sendMessageRequest 302861847f8eSopenharmony_ci */ 302961847f8eSopenharmony_ci sendRequest( 303061847f8eSopenharmony_ci code: number, 303161847f8eSopenharmony_ci data: MessageParcel, 303261847f8eSopenharmony_ci reply: MessageParcel, 303361847f8eSopenharmony_ci options: MessageOption 303461847f8eSopenharmony_ci ): Promise<SendRequestResult>; 303561847f8eSopenharmony_ci 303661847f8eSopenharmony_ci /** 303761847f8eSopenharmony_ci * Sends a {@link MessageSequence} message to the peer process in synchronous or asynchronous mode. 303861847f8eSopenharmony_ci * <p>If options indicates the asynchronous mode, a promise will be fulfilled immediately 303961847f8eSopenharmony_ci * and the reply message does not contain any content. If options indicates the synchronous mode, 304061847f8eSopenharmony_ci * a promise will be fulfilled when the response to sendMessageRequest is returned, 304161847f8eSopenharmony_ci * and the reply message contains the returned information. 304261847f8eSopenharmony_ci * 304361847f8eSopenharmony_ci * @param { number } code - Message code called by the request, which is determined by the client and server. 304461847f8eSopenharmony_ci * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. 304561847f8eSopenharmony_ci * @param { MessageSequence } data - {@link MessageSequence} object holding the data to send. 304661847f8eSopenharmony_ci * @param { MessageSequence } reply - {@link MessageSequence} object that receives the response. 304761847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 304861847f8eSopenharmony_ci * @returns { Promise<RequestResult> } Promise used to return the {@link RequestResult} instance. 304961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 305061847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 305161847f8eSopenharmony_ci * 2.The parameter type does not match; 305261847f8eSopenharmony_ci * 3.Failed to obtain the passed object instance. 305361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 305461847f8eSopenharmony_ci * @since 9 305561847f8eSopenharmony_ci */ 305661847f8eSopenharmony_ci sendMessageRequest( 305761847f8eSopenharmony_ci code: number, 305861847f8eSopenharmony_ci data: MessageSequence, 305961847f8eSopenharmony_ci reply: MessageSequence, 306061847f8eSopenharmony_ci options: MessageOption 306161847f8eSopenharmony_ci ): Promise<RequestResult>; 306261847f8eSopenharmony_ci 306361847f8eSopenharmony_ci /** 306461847f8eSopenharmony_ci * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. 306561847f8eSopenharmony_ci * <p>If options indicates the asynchronous mode, a callback will be invoked immediately 306661847f8eSopenharmony_ci * and the reply message does not contain any content. If options indicates the synchronous mode, 306761847f8eSopenharmony_ci * a callback will be invoked when the response to sendRequest is returned, 306861847f8eSopenharmony_ci * and the reply message contains the returned information. 306961847f8eSopenharmony_ci * 307061847f8eSopenharmony_ci * @param { number } code - Message code called by the request, which is determined by the client and server. 307161847f8eSopenharmony_ci * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. 307261847f8eSopenharmony_ci * @param { MessageParcel } data - {@link MessageParcel} object holding the data to send. 307361847f8eSopenharmony_ci * @param { MessageParcel} reply - {@link MessageParcel} object that receives the response. 307461847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 307561847f8eSopenharmony_ci * @param { AsyncCallback<SendRequestResult> } callback - Callback for receiving the sending result. 307661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 307761847f8eSopenharmony_ci * @since 8 307861847f8eSopenharmony_ci * @deprecated since 9 307961847f8eSopenharmony_ci * @useinstead ohos.rpc.RemoteObject#sendMessageRequest 308061847f8eSopenharmony_ci */ 308161847f8eSopenharmony_ci sendRequest( 308261847f8eSopenharmony_ci code: number, 308361847f8eSopenharmony_ci data: MessageParcel, 308461847f8eSopenharmony_ci reply: MessageParcel, 308561847f8eSopenharmony_ci options: MessageOption, 308661847f8eSopenharmony_ci callback: AsyncCallback<SendRequestResult> 308761847f8eSopenharmony_ci ): void; 308861847f8eSopenharmony_ci 308961847f8eSopenharmony_ci /** 309061847f8eSopenharmony_ci * Sends a {@link MessageSequence} message to the peer process in synchronous or asynchronous mode. 309161847f8eSopenharmony_ci * <p>If options indicates the asynchronous mode, a callback will be invoked immediately 309261847f8eSopenharmony_ci * and the reply message does not contain any content. If options indicates the synchronous mode, 309361847f8eSopenharmony_ci * a callback will be invoked when the response to sendMessageRequest is returned, 309461847f8eSopenharmony_ci * and the reply message contains the returned information. 309561847f8eSopenharmony_ci * 309661847f8eSopenharmony_ci * @param { number } code - Message code called by the request, which is determined by the client and server. 309761847f8eSopenharmony_ci * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. 309861847f8eSopenharmony_ci * @param { MessageSequence } data - {@link MessageSequence} object holding the data to send. 309961847f8eSopenharmony_ci * @param { MessageSequence } reply - {@link MessageSequence} object that receives the response. 310061847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 310161847f8eSopenharmony_ci * @param { AsyncCallback<RequestResult> } callback - Callback for receiving the sending result. 310261847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 310361847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 310461847f8eSopenharmony_ci * 2.The parameter type does not match; 310561847f8eSopenharmony_ci * 3.Failed to obtain the passed object instance. 310661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 310761847f8eSopenharmony_ci * @since 9 310861847f8eSopenharmony_ci */ 310961847f8eSopenharmony_ci sendMessageRequest( 311061847f8eSopenharmony_ci code: number, 311161847f8eSopenharmony_ci data: MessageSequence, 311261847f8eSopenharmony_ci reply: MessageSequence, 311361847f8eSopenharmony_ci options: MessageOption, 311461847f8eSopenharmony_ci callback: AsyncCallback<RequestResult> 311561847f8eSopenharmony_ci ): void; 311661847f8eSopenharmony_ci 311761847f8eSopenharmony_ci /** 311861847f8eSopenharmony_ci * Obtains the PID of the {@link RemoteProxy} object. 311961847f8eSopenharmony_ci * 312061847f8eSopenharmony_ci * @returns { number } Return the PID of the {@link RemoteProxy} object. 312161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 312261847f8eSopenharmony_ci * @since 7 312361847f8eSopenharmony_ci */ 312461847f8eSopenharmony_ci getCallingPid(): number; 312561847f8eSopenharmony_ci 312661847f8eSopenharmony_ci /** 312761847f8eSopenharmony_ci * Obtains the UID of the {@link RemoteProxy} object. 312861847f8eSopenharmony_ci * 312961847f8eSopenharmony_ci * @returns { number } Return the UID of the {@link RemoteProxy} object. 313061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 313161847f8eSopenharmony_ci * @since 7 313261847f8eSopenharmony_ci */ 313361847f8eSopenharmony_ci getCallingUid(): number; 313461847f8eSopenharmony_ci 313561847f8eSopenharmony_ci /** 313661847f8eSopenharmony_ci * Modifies the description of the current {@code RemoteObject}. 313761847f8eSopenharmony_ci * <p>This method is used to change the default descriptor specified during the creation of {@code RemoteObject}. 313861847f8eSopenharmony_ci * 313961847f8eSopenharmony_ci * @param { IRemoteBroker } localInterface - Indicates the {@code RemoteObject} whose descriptor is to be changed. 314061847f8eSopenharmony_ci * @param { string } descriptor - Indicates the new descriptor of the {@code RemoteObject}. 314161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 314261847f8eSopenharmony_ci * @since 7 314361847f8eSopenharmony_ci * @deprecated since 9 314461847f8eSopenharmony_ci * @useinstead ohos.rpc.RemoteObject#modifyLocalInterface 314561847f8eSopenharmony_ci */ 314661847f8eSopenharmony_ci attachLocalInterface(localInterface: IRemoteBroker, descriptor: string): void; 314761847f8eSopenharmony_ci 314861847f8eSopenharmony_ci /** 314961847f8eSopenharmony_ci * Modifies the description of the current {@code RemoteObject}. 315061847f8eSopenharmony_ci * <p>This method is used to change the default descriptor specified during the creation of {@code RemoteObject}. 315161847f8eSopenharmony_ci * 315261847f8eSopenharmony_ci * @param { IRemoteBroker } localInterface - Indicates the {@code RemoteObject} whose descriptor is to be changed. 315361847f8eSopenharmony_ci * @param { string } descriptor - Indicates the new descriptor of the {@code RemoteObject}. 315461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 315561847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 315661847f8eSopenharmony_ci * 2.The parameter type does not match; 315761847f8eSopenharmony_ci * 3.The string length exceeds 40960 bytes; 315861847f8eSopenharmony_ci * 4.The number of bytes copied to the buffer is different from the length of the obtained string. 315961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 316061847f8eSopenharmony_ci * @since 9 316161847f8eSopenharmony_ci */ 316261847f8eSopenharmony_ci modifyLocalInterface(localInterface: IRemoteBroker, descriptor: string): void; 316361847f8eSopenharmony_ci } 316461847f8eSopenharmony_ci 316561847f8eSopenharmony_ci /** 316661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 316761847f8eSopenharmony_ci * @since 7 316861847f8eSopenharmony_ci */ 316961847f8eSopenharmony_ci /** 317061847f8eSopenharmony_ci * Implement the IRemoteObject proxy object. 317161847f8eSopenharmony_ci * 317261847f8eSopenharmony_ci * @extends IRemoteObject 317361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 317461847f8eSopenharmony_ci * @since 11 317561847f8eSopenharmony_ci */ 317661847f8eSopenharmony_ci class RemoteProxy extends IRemoteObject { 317761847f8eSopenharmony_ci /** 317861847f8eSopenharmony_ci * Indicates the message code for a Ping operation. 317961847f8eSopenharmony_ci * 318061847f8eSopenharmony_ci * @type { number } 318161847f8eSopenharmony_ci * @default 1599098439 318261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 318361847f8eSopenharmony_ci * @since 7 318461847f8eSopenharmony_ci */ 318561847f8eSopenharmony_ci PING_TRANSACTION: number; 318661847f8eSopenharmony_ci 318761847f8eSopenharmony_ci /** 318861847f8eSopenharmony_ci * Indicates the message code for a dump operation. 318961847f8eSopenharmony_ci * 319061847f8eSopenharmony_ci * @type { number } 319161847f8eSopenharmony_ci * @default 1598311760 319261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 319361847f8eSopenharmony_ci * @since 7 319461847f8eSopenharmony_ci */ 319561847f8eSopenharmony_ci DUMP_TRANSACTION: number; 319661847f8eSopenharmony_ci 319761847f8eSopenharmony_ci /** 319861847f8eSopenharmony_ci * Indicates the message code for a transmission. 319961847f8eSopenharmony_ci * 320061847f8eSopenharmony_ci * @type { number } 320161847f8eSopenharmony_ci * @default 1598968902 320261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 320361847f8eSopenharmony_ci * @since 7 320461847f8eSopenharmony_ci */ 320561847f8eSopenharmony_ci INTERFACE_TRANSACTION: number; 320661847f8eSopenharmony_ci 320761847f8eSopenharmony_ci /** 320861847f8eSopenharmony_ci * Indicates the minimum value of a valid message code. 320961847f8eSopenharmony_ci * <p>This constant is used to check the validity of an operation. 321061847f8eSopenharmony_ci * 321161847f8eSopenharmony_ci * @type { number } 321261847f8eSopenharmony_ci * @default 0x1 321361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 321461847f8eSopenharmony_ci * @since 7 321561847f8eSopenharmony_ci */ 321661847f8eSopenharmony_ci MIN_TRANSACTION_ID: number; 321761847f8eSopenharmony_ci 321861847f8eSopenharmony_ci /** 321961847f8eSopenharmony_ci * Indicates the maximum value of a valid message code. 322061847f8eSopenharmony_ci * <p>This constant is used to check the validity of an operation. 322161847f8eSopenharmony_ci * 322261847f8eSopenharmony_ci * @type { number } 322361847f8eSopenharmony_ci * @default 0x00FFFFFF 322461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 322561847f8eSopenharmony_ci * @since 7 322661847f8eSopenharmony_ci */ 322761847f8eSopenharmony_ci MAX_TRANSACTION_ID: number; 322861847f8eSopenharmony_ci 322961847f8eSopenharmony_ci /** 323061847f8eSopenharmony_ci * Queries a local interface with a specified descriptor. 323161847f8eSopenharmony_ci * 323261847f8eSopenharmony_ci * @param { string } interface - Indicates the descriptor of the interface to query. 323361847f8eSopenharmony_ci * @returns { IRemoteBroker } Return null by default, indicating a proxy interface. 323461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 323561847f8eSopenharmony_ci * @since 7 323661847f8eSopenharmony_ci * @deprecated since 9 323761847f8eSopenharmony_ci * @useinstead ohos.rpc.RemoteProxy#getLocalInterface 323861847f8eSopenharmony_ci */ 323961847f8eSopenharmony_ci queryLocalInterface(interface: string): IRemoteBroker; 324061847f8eSopenharmony_ci 324161847f8eSopenharmony_ci /** 324261847f8eSopenharmony_ci * Queries a local interface with a specified descriptor. 324361847f8eSopenharmony_ci * 324461847f8eSopenharmony_ci * @param { string } interface - Indicates the descriptor of the interface to query. 324561847f8eSopenharmony_ci * @returns { IRemoteBroker } Return null by default, indicating a proxy interface. 324661847f8eSopenharmony_ci * @throws { BusinessError } 401 - check param failed 324761847f8eSopenharmony_ci * @throws { BusinessError } 1900006 - Operation allowed only for the remote object. 324861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 324961847f8eSopenharmony_ci * @since 9 325061847f8eSopenharmony_ci */ 325161847f8eSopenharmony_ci getLocalInterface(interface: string): IRemoteBroker; 325261847f8eSopenharmony_ci 325361847f8eSopenharmony_ci /** 325461847f8eSopenharmony_ci * Register a callback used to receive death notifications of a remote object. 325561847f8eSopenharmony_ci * 325661847f8eSopenharmony_ci * @param { DeathRecipient } recipient - Indicates the callback to be registered. 325761847f8eSopenharmony_ci * @param { number } flags - Indicates the flag of the death notification. This is a reserved parameter. 325861847f8eSopenharmony_ci * Set it to {@code 0}. 325961847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the callback is registered successfully; 326061847f8eSopenharmony_ci * return {@code false} otherwise. 326161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 326261847f8eSopenharmony_ci * @since 7 326361847f8eSopenharmony_ci * @deprecated since 9 326461847f8eSopenharmony_ci * @useinstead ohos.rpc.RemoteProxy#registerDeathRecipient 326561847f8eSopenharmony_ci */ 326661847f8eSopenharmony_ci addDeathRecipient(recipient: DeathRecipient, flags: number): boolean; 326761847f8eSopenharmony_ci 326861847f8eSopenharmony_ci /** 326961847f8eSopenharmony_ci * Register a callback used to receive death notifications of a remote object. 327061847f8eSopenharmony_ci * 327161847f8eSopenharmony_ci * @param { DeathRecipient } recipient - Indicates the callback to be registered. 327261847f8eSopenharmony_ci * @param { number } flags - Indicates the flag of the death notification. This is a reserved parameter. 327361847f8eSopenharmony_ci * Set it to {@code 0}. 327461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 327561847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 327661847f8eSopenharmony_ci * 2.The parameter type does not match; 327761847f8eSopenharmony_ci * 3.The callback used to receive remote object death notifications is empty. 327861847f8eSopenharmony_ci * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. 327961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 328061847f8eSopenharmony_ci * @since 9 328161847f8eSopenharmony_ci */ 328261847f8eSopenharmony_ci registerDeathRecipient(recipient: DeathRecipient, flags: number): void; 328361847f8eSopenharmony_ci 328461847f8eSopenharmony_ci /** 328561847f8eSopenharmony_ci * Unregister a callback used to receive death notifications of a remote object. 328661847f8eSopenharmony_ci * 328761847f8eSopenharmony_ci * @param { DeathRecipient } recipient - Indicates the callback to be unregister. 328861847f8eSopenharmony_ci * @param { number } flags - Indicates the flag of the death notification. This is a reserved parameter. 328961847f8eSopenharmony_ci * Set it to {@code 0}. 329061847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the callback is unregister successfully; 329161847f8eSopenharmony_ci * return {@code false} otherwise. 329261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 329361847f8eSopenharmony_ci * @since 7 329461847f8eSopenharmony_ci * @deprecated since 9 329561847f8eSopenharmony_ci * @useinstead ohos.rpc.RemoteProxy#unregisterDeathRecipient 329661847f8eSopenharmony_ci */ 329761847f8eSopenharmony_ci removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean; 329861847f8eSopenharmony_ci 329961847f8eSopenharmony_ci /** 330061847f8eSopenharmony_ci * Unregister a callback used to receive death notifications of a remote object. 330161847f8eSopenharmony_ci * 330261847f8eSopenharmony_ci * @param { DeathRecipient } recipient - Indicates the callback to be unregister. 330361847f8eSopenharmony_ci * @param { number } flags - Indicates the flag of the death notification. This is a reserved parameter. 330461847f8eSopenharmony_ci * Set it to {@code 0}. 330561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 330661847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 330761847f8eSopenharmony_ci * 2.The parameter type does not match; 330861847f8eSopenharmony_ci * 3.The callback used to receive remote object death notifications is empty. 330961847f8eSopenharmony_ci * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. 331061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 331161847f8eSopenharmony_ci * @since 9 331261847f8eSopenharmony_ci */ 331361847f8eSopenharmony_ci unregisterDeathRecipient(recipient: DeathRecipient, flags: number): void; 331461847f8eSopenharmony_ci 331561847f8eSopenharmony_ci /** 331661847f8eSopenharmony_ci * Queries the interface descriptor of remote object. 331761847f8eSopenharmony_ci * 331861847f8eSopenharmony_ci * @returns { string } Return the interface descriptor. 331961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 332061847f8eSopenharmony_ci * @since 7 332161847f8eSopenharmony_ci * @deprecated since 9 332261847f8eSopenharmony_ci * @useinstead ohos.rpc.RemoteProxy#getDescriptor 332361847f8eSopenharmony_ci */ 332461847f8eSopenharmony_ci getInterfaceDescriptor(): string; 332561847f8eSopenharmony_ci 332661847f8eSopenharmony_ci /** 332761847f8eSopenharmony_ci * Queries the interface descriptor of remote object. 332861847f8eSopenharmony_ci * 332961847f8eSopenharmony_ci * @returns { string } Return the interface descriptor. 333061847f8eSopenharmony_ci * @throws { BusinessError } 1900007 - communication failed. 333161847f8eSopenharmony_ci * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. 333261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 333361847f8eSopenharmony_ci * @since 9 333461847f8eSopenharmony_ci */ 333561847f8eSopenharmony_ci getDescriptor(): string; 333661847f8eSopenharmony_ci 333761847f8eSopenharmony_ci /** 333861847f8eSopenharmony_ci * Sends a request to the peer object. 333961847f8eSopenharmony_ci * <p>If the peer object and {@code RemoteProxy} are on the same device, the request is sent by the IPC driver. 334061847f8eSopenharmony_ci * If they are on different devices, the request is sent by the socket driver. 334161847f8eSopenharmony_ci * 334261847f8eSopenharmony_ci * @param { number } code - Indicates the message code of the request. 334361847f8eSopenharmony_ci * @param { MessageParcel } data - Indicates the {@link MessageParcel} object storing the data to be sent. 334461847f8eSopenharmony_ci * @param { MessageParcel } reply - Indicates the {@link MessageParcel} object receiving the response data. 334561847f8eSopenharmony_ci * @param { MessageOption } options - Indicates a synchronous (default) or asynchronous request. 334661847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the operation succeeds; return {@code false} otherwise. 334761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 334861847f8eSopenharmony_ci * @since 7 334961847f8eSopenharmony_ci * @deprecated since 8 335061847f8eSopenharmony_ci */ 335161847f8eSopenharmony_ci sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; 335261847f8eSopenharmony_ci 335361847f8eSopenharmony_ci /** 335461847f8eSopenharmony_ci * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. 335561847f8eSopenharmony_ci * <p>If options indicates the asynchronous mode, a promise will be fulfilled immediately 335661847f8eSopenharmony_ci * and the reply message does not contain any content. If options indicates the synchronous mode, 335761847f8eSopenharmony_ci * a promise will be fulfilled when the response to sendRequest is returned, 335861847f8eSopenharmony_ci * and the reply message contains the returned information. 335961847f8eSopenharmony_ci * 336061847f8eSopenharmony_ci * @param { number } code - Message code called by the request, which is determined by the client and server. 336161847f8eSopenharmony_ci * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. 336261847f8eSopenharmony_ci * @param { MessageParcel } data - {@link MessageParcel} object holding the data to send. 336361847f8eSopenharmony_ci * @param { MessageParcel} reply - {@link MessageParcel} object that receives the response. 336461847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 336561847f8eSopenharmony_ci * @returns { Promise<SendRequestResult> } Promise used to return the {@link sendRequestResult} instance. 336661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 336761847f8eSopenharmony_ci * @since 8 336861847f8eSopenharmony_ci * @deprecated since 9 336961847f8eSopenharmony_ci * @useinstead ohos.rpc.RemoteProxy#sendMessageRequest 337061847f8eSopenharmony_ci */ 337161847f8eSopenharmony_ci sendRequest( 337261847f8eSopenharmony_ci code: number, 337361847f8eSopenharmony_ci data: MessageParcel, 337461847f8eSopenharmony_ci reply: MessageParcel, 337561847f8eSopenharmony_ci options: MessageOption 337661847f8eSopenharmony_ci ): Promise<SendRequestResult>; 337761847f8eSopenharmony_ci 337861847f8eSopenharmony_ci /** 337961847f8eSopenharmony_ci * Sends a {@link MessageSequence} message to the peer process in synchronous or asynchronous mode. 338061847f8eSopenharmony_ci * <p>If options indicates the asynchronous mode, a promise will be fulfilled immediately 338161847f8eSopenharmony_ci * and the reply message does not contain any content. If options indicates the synchronous mode, 338261847f8eSopenharmony_ci * a promise will be fulfilled when the response to sendMessageRequest is returned, 338361847f8eSopenharmony_ci * and the reply message contains the returned information. 338461847f8eSopenharmony_ci * 338561847f8eSopenharmony_ci * @param { number } code - Message code called by the request, which is determined by the client and server. 338661847f8eSopenharmony_ci * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. 338761847f8eSopenharmony_ci * @param { MessageSequence } data - {@link MessageSequence} object holding the data to send. 338861847f8eSopenharmony_ci * @param { MessageSequence } reply - {@link MessageSequence} object that receives the response. 338961847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 339061847f8eSopenharmony_ci * @returns { Promise<RequestResult> } Promise used to return the {@link RequestResult} instance. 339161847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 339261847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 339361847f8eSopenharmony_ci * 2.The parameter type does not match; 339461847f8eSopenharmony_ci * 3.Failed to obtain the passed object instance. 339561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 339661847f8eSopenharmony_ci * @since 9 339761847f8eSopenharmony_ci */ 339861847f8eSopenharmony_ci sendMessageRequest( 339961847f8eSopenharmony_ci code: number, 340061847f8eSopenharmony_ci data: MessageSequence, 340161847f8eSopenharmony_ci reply: MessageSequence, 340261847f8eSopenharmony_ci options: MessageOption 340361847f8eSopenharmony_ci ): Promise<RequestResult>; 340461847f8eSopenharmony_ci 340561847f8eSopenharmony_ci /** 340661847f8eSopenharmony_ci * Sends a {@link MessageParcel} message to the peer process in synchronous or asynchronous mode. 340761847f8eSopenharmony_ci * <p>If options indicates the asynchronous mode, a callback will be invoked immediately 340861847f8eSopenharmony_ci * and the reply message does not contain any content. If options indicates the synchronous mode, 340961847f8eSopenharmony_ci * a callback will be invoked when the response to sendRequest is returned, 341061847f8eSopenharmony_ci * and the reply message contains the returned information. 341161847f8eSopenharmony_ci * 341261847f8eSopenharmony_ci * @param { number } code - Message code called by the request, which is determined by the client and server. 341361847f8eSopenharmony_ci * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. 341461847f8eSopenharmony_ci * @param { MessageParcel } data - {@link MessageParcel} object holding the data to send. 341561847f8eSopenharmony_ci * @param { MessageParcel } reply - {@link MessageParcel} object that receives the response. 341661847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 341761847f8eSopenharmony_ci * @param { AsyncCallback<SendRequestResult> } callback - Callback for receiving the sending result. 341861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 341961847f8eSopenharmony_ci * @since 8 342061847f8eSopenharmony_ci * @deprecated since 9 342161847f8eSopenharmony_ci * @useinstead ohos.rpc.RemoteProxy#sendMessageRequest 342261847f8eSopenharmony_ci */ 342361847f8eSopenharmony_ci sendRequest( 342461847f8eSopenharmony_ci code: number, 342561847f8eSopenharmony_ci data: MessageParcel, 342661847f8eSopenharmony_ci reply: MessageParcel, 342761847f8eSopenharmony_ci options: MessageOption, 342861847f8eSopenharmony_ci callback: AsyncCallback<SendRequestResult> 342961847f8eSopenharmony_ci ): void; 343061847f8eSopenharmony_ci 343161847f8eSopenharmony_ci /** 343261847f8eSopenharmony_ci * Sends a {@link MessageSequence} message to the peer process in synchronous or asynchronous mode. 343361847f8eSopenharmony_ci * <p>If options indicates the asynchronous mode, a callback will be invoked immediately 343461847f8eSopenharmony_ci * and the reply message does not contain any content. If options indicates the synchronous mode, 343561847f8eSopenharmony_ci * a callback will be invoked when the response to sendRequest is returned, 343661847f8eSopenharmony_ci * and the reply message contains the returned information. 343761847f8eSopenharmony_ci * 343861847f8eSopenharmony_ci * @param { number } code - Message code called by the request, which is determined by the client and server. 343961847f8eSopenharmony_ci * If the method is generated by an IDL tool, the message code is automatically generated by the IDL tool. 344061847f8eSopenharmony_ci * @param { MessageSequence } data - {@link MessageSequence} object holding the data to send. 344161847f8eSopenharmony_ci * @param { MessageSequence } reply - {@link MessageSequence} object that receives the response. 344261847f8eSopenharmony_ci * @param { MessageOption } options - Indicates the synchronous or asynchronous mode to send messages. 344361847f8eSopenharmony_ci * @param { AsyncCallback<RequestResult> } callback - Callback for receiving the sending result. 344461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 344561847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 344661847f8eSopenharmony_ci * 2.The parameter type does not match; 344761847f8eSopenharmony_ci * 3.Failed to obtain the passed object instance. 344861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 344961847f8eSopenharmony_ci * @since 9 345061847f8eSopenharmony_ci */ 345161847f8eSopenharmony_ci sendMessageRequest( 345261847f8eSopenharmony_ci code: number, 345361847f8eSopenharmony_ci data: MessageSequence, 345461847f8eSopenharmony_ci reply: MessageSequence, 345561847f8eSopenharmony_ci options: MessageOption, 345661847f8eSopenharmony_ci callback: AsyncCallback<RequestResult> 345761847f8eSopenharmony_ci ): void; 345861847f8eSopenharmony_ci 345961847f8eSopenharmony_ci /** 346061847f8eSopenharmony_ci * Checks whether the {@code RemoteObject} corresponding to a {@code RemoteProxy} is dead. 346161847f8eSopenharmony_ci * 346261847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the {@code RemoteObject} is dead; return {@code false} otherwise. 346361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 346461847f8eSopenharmony_ci * @since 7 346561847f8eSopenharmony_ci */ 346661847f8eSopenharmony_ci isObjectDead(): boolean; 346761847f8eSopenharmony_ci } 346861847f8eSopenharmony_ci 346961847f8eSopenharmony_ci /** 347061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 347161847f8eSopenharmony_ci * @since 7 347261847f8eSopenharmony_ci */ 347361847f8eSopenharmony_ci /** 347461847f8eSopenharmony_ci * Used to obtain IPC context information, including obtaining the UID and PID, obtaining the local and 347561847f8eSopenharmony_ci * peer device IDs, and checking whether the API call is on the same device. 347661847f8eSopenharmony_ci * 347761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 347861847f8eSopenharmony_ci * @since 11 347961847f8eSopenharmony_ci */ 348061847f8eSopenharmony_ci class IPCSkeleton { 348161847f8eSopenharmony_ci /** 348261847f8eSopenharmony_ci * Obtains a local {@link IRemoteObject} reference of a registered service. 348361847f8eSopenharmony_ci * <p>This method is static. 348461847f8eSopenharmony_ci * 348561847f8eSopenharmony_ci * @returns { IRemoteObject } Return an {@link IRemoteObject} reference of the registered service. 348661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 348761847f8eSopenharmony_ci * @since 7 348861847f8eSopenharmony_ci */ 348961847f8eSopenharmony_ci static getContextObject(): IRemoteObject; 349061847f8eSopenharmony_ci 349161847f8eSopenharmony_ci /** 349261847f8eSopenharmony_ci * Obtains the PID of a proxy. 349361847f8eSopenharmony_ci * <p>This method is static. The PID is a positive integer during the communication between 349461847f8eSopenharmony_ci * the {@link RemoteProxy} object and {@link RemoteObject} object, and resumes to {@code 0} 349561847f8eSopenharmony_ci * when the communication ends. If this method is called from the {@link RemoteProxy} object, 349661847f8eSopenharmony_ci * {@code 0} is returned; if this method is called from the {@link RemoteObject} object, 349761847f8eSopenharmony_ci * the PID of the corresponding {@link RemoteProxy} object is returned. 349861847f8eSopenharmony_ci * 349961847f8eSopenharmony_ci * @returns { number } Return the PID of the proxy. 350061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 350161847f8eSopenharmony_ci * @since 7 350261847f8eSopenharmony_ci */ 350361847f8eSopenharmony_ci static getCallingPid(): number; 350461847f8eSopenharmony_ci 350561847f8eSopenharmony_ci /** 350661847f8eSopenharmony_ci * Obtains the UID of a proxy. 350761847f8eSopenharmony_ci * <p>This method is static. The UID is a positive integer during the communication between 350861847f8eSopenharmony_ci * the {@link RemoteProxy} object and {@link RemoteObject} object, and resumes to {@code 0} 350961847f8eSopenharmony_ci * when the communication ends. If this method is called from the {@link RemoteProxy} object, 351061847f8eSopenharmony_ci * {@code 0} is returned; if this method is called from the {@link RemoteObject} object, 351161847f8eSopenharmony_ci * the UID of the corresponding {@link RemoteProxy} object is returned. 351261847f8eSopenharmony_ci * 351361847f8eSopenharmony_ci * @returns { number } Return the UID of the proxy. 351461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 351561847f8eSopenharmony_ci * @since 7 351661847f8eSopenharmony_ci */ 351761847f8eSopenharmony_ci static getCallingUid(): number; 351861847f8eSopenharmony_ci 351961847f8eSopenharmony_ci /** 352061847f8eSopenharmony_ci * Obtains the TOKENID. 352161847f8eSopenharmony_ci * <p>This method is static. 352261847f8eSopenharmony_ci * 352361847f8eSopenharmony_ci * @returns { number } Return the TOKENID. 352461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 352561847f8eSopenharmony_ci * @since 8 352661847f8eSopenharmony_ci */ 352761847f8eSopenharmony_ci static getCallingTokenId(): number; 352861847f8eSopenharmony_ci 352961847f8eSopenharmony_ci /** 353061847f8eSopenharmony_ci * Obtains the ID of the device where the peer process resides. 353161847f8eSopenharmony_ci * <p>This method is static. 353261847f8eSopenharmony_ci * 353361847f8eSopenharmony_ci * @returns { string } Return the ID of the device where the peer process resides. 353461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 353561847f8eSopenharmony_ci * @since 7 353661847f8eSopenharmony_ci */ 353761847f8eSopenharmony_ci static getCallingDeviceID(): string; 353861847f8eSopenharmony_ci 353961847f8eSopenharmony_ci /** 354061847f8eSopenharmony_ci * Obtains the ID of the local device. 354161847f8eSopenharmony_ci * <p>This method is static. 354261847f8eSopenharmony_ci * 354361847f8eSopenharmony_ci * @returns { string } Return the ID of the local device. 354461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 354561847f8eSopenharmony_ci * @since 7 354661847f8eSopenharmony_ci */ 354761847f8eSopenharmony_ci static getLocalDeviceID(): string; 354861847f8eSopenharmony_ci 354961847f8eSopenharmony_ci /** 355061847f8eSopenharmony_ci * Checks whether a call is made on the same device. 355161847f8eSopenharmony_ci * <p>This method is static. 355261847f8eSopenharmony_ci * 355361847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the call is made on the same device; return {@code false} otherwise. 355461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 355561847f8eSopenharmony_ci * @since 7 355661847f8eSopenharmony_ci */ 355761847f8eSopenharmony_ci static isLocalCalling(): boolean; 355861847f8eSopenharmony_ci 355961847f8eSopenharmony_ci /** 356061847f8eSopenharmony_ci * Flush all pending commands from a specified {@link RemoteProxy} to the corresponding {@link RemoteObject}. 356161847f8eSopenharmony_ci * <p>This method is static. You are advised to call this method before performing any time-sensitive operations. 356261847f8eSopenharmony_ci * 356361847f8eSopenharmony_ci * @param { IRemoteObject } object - Indicates the specified {@link RemoteProxy}. 356461847f8eSopenharmony_ci * @returns { number } Return {@code 0} if the operation succeeds; return an error code if the input object 356561847f8eSopenharmony_ci * is empty or {@link RemoteObject}, or the operation fails. 356661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 356761847f8eSopenharmony_ci * @since 7 356861847f8eSopenharmony_ci * @deprecated since 9 356961847f8eSopenharmony_ci * @useinstead ohos.rpc.IPCSkeleton#flushCmdBuffer 357061847f8eSopenharmony_ci */ 357161847f8eSopenharmony_ci static flushCommands(object: IRemoteObject): number; 357261847f8eSopenharmony_ci 357361847f8eSopenharmony_ci /** 357461847f8eSopenharmony_ci * Flush all pending commands from a specified {@link RemoteProxy} to the corresponding {@link RemoteObject}. 357561847f8eSopenharmony_ci * <p>This method is static. You are advised to call this method before performing any time-sensitive operations. 357661847f8eSopenharmony_ci * 357761847f8eSopenharmony_ci * @param { IRemoteObject } object - Indicates the specified {@link RemoteProxy}. 357861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 357961847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 358061847f8eSopenharmony_ci * 2.The parameter type does not match. 358161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 358261847f8eSopenharmony_ci * @since 9 358361847f8eSopenharmony_ci */ 358461847f8eSopenharmony_ci static flushCmdBuffer(object: IRemoteObject): void; 358561847f8eSopenharmony_ci 358661847f8eSopenharmony_ci /** 358761847f8eSopenharmony_ci * Replaces the UID and PID of the remote user with those of the local user. 358861847f8eSopenharmony_ci * <p>This method is static. It can be used in scenarios like authentication. 358961847f8eSopenharmony_ci * 359061847f8eSopenharmony_ci * @returns { string } Return a string containing the UID and PID of the remote user. 359161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 359261847f8eSopenharmony_ci * @since 7 359361847f8eSopenharmony_ci */ 359461847f8eSopenharmony_ci static resetCallingIdentity(): string; 359561847f8eSopenharmony_ci 359661847f8eSopenharmony_ci /** 359761847f8eSopenharmony_ci * Restore the UID and PID to those of the remote user. 359861847f8eSopenharmony_ci * <p>This method is static. It is usually called after {@code resetCallingIdentity} is used 359961847f8eSopenharmony_ci * and requires the UID and PID of the remote user returned by {@code resetCallingIdentity}. 360061847f8eSopenharmony_ci * 360161847f8eSopenharmony_ci * @param { string } identity - Indicates the string containing the UID and PID of the remote user, 360261847f8eSopenharmony_ci * which is returned by {@code resetCallingIdentity}. 360361847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the operation succeeds; return {@code false} otherwise. 360461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 360561847f8eSopenharmony_ci * @since 7 360661847f8eSopenharmony_ci * @deprecated since 9 360761847f8eSopenharmony_ci * @useinstead ohos.rpc.IPCSkeleton#restoreCallingIdentity 360861847f8eSopenharmony_ci */ 360961847f8eSopenharmony_ci static setCallingIdentity(identity: string): boolean; 361061847f8eSopenharmony_ci 361161847f8eSopenharmony_ci /** 361261847f8eSopenharmony_ci * Restore the UID and PID to those of the remote user. 361361847f8eSopenharmony_ci * <p>This method is static. It is usually called after {@code resetCallingIdentity} is used 361461847f8eSopenharmony_ci * and requires the UID and PID of the remote user returned by {@code resetCallingIdentity}. 361561847f8eSopenharmony_ci * 361661847f8eSopenharmony_ci * @param { string } identity - Indicates the string containing the UID and PID of the remote user, 361761847f8eSopenharmony_ci * which is returned by {@code resetCallingIdentity}. 361861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 361961847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 362061847f8eSopenharmony_ci * 2.The parameter type does not match; 362161847f8eSopenharmony_ci * 3.The string length exceeds 40960 bytes; 362261847f8eSopenharmony_ci * 4.The number of bytes copied to the buffer is different from the length of the obtained string. 362361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 362461847f8eSopenharmony_ci * @since 9 362561847f8eSopenharmony_ci */ 362661847f8eSopenharmony_ci static restoreCallingIdentity(identity: string): void; 362761847f8eSopenharmony_ci } 362861847f8eSopenharmony_ci 362961847f8eSopenharmony_ci /** 363061847f8eSopenharmony_ci * Provides methods related to anonymous shared memory objects, 363161847f8eSopenharmony_ci * including creating, closing, mapping, and unmapping an Ashmem object, 363261847f8eSopenharmony_ci * reading data from and writing data to an Ashmem object, 363361847f8eSopenharmony_ci * obtaining the Ashmem size, and setting Ashmem protection. 363461847f8eSopenharmony_ci * 363561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 363661847f8eSopenharmony_ci * @since 8 363761847f8eSopenharmony_ci */ 363861847f8eSopenharmony_ci class Ashmem { 363961847f8eSopenharmony_ci /** 364061847f8eSopenharmony_ci * The mapped memory is executable. 364161847f8eSopenharmony_ci * 364261847f8eSopenharmony_ci * @type { number } 364361847f8eSopenharmony_ci * @default 4 364461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 364561847f8eSopenharmony_ci * @since 8 364661847f8eSopenharmony_ci */ 364761847f8eSopenharmony_ci PROT_EXEC: number; 364861847f8eSopenharmony_ci 364961847f8eSopenharmony_ci /** 365061847f8eSopenharmony_ci * The mapped memory is inaccessible. 365161847f8eSopenharmony_ci * 365261847f8eSopenharmony_ci * @type { number } 365361847f8eSopenharmony_ci * @default 0 365461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 365561847f8eSopenharmony_ci * @since 8 365661847f8eSopenharmony_ci */ 365761847f8eSopenharmony_ci PROT_NONE: number; 365861847f8eSopenharmony_ci 365961847f8eSopenharmony_ci /** 366061847f8eSopenharmony_ci * The mapped memory is readable. 366161847f8eSopenharmony_ci * 366261847f8eSopenharmony_ci * @type { number } 366361847f8eSopenharmony_ci * @default 1 366461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 366561847f8eSopenharmony_ci * @since 8 366661847f8eSopenharmony_ci */ 366761847f8eSopenharmony_ci PROT_READ: number; 366861847f8eSopenharmony_ci 366961847f8eSopenharmony_ci /** 367061847f8eSopenharmony_ci * The mapped memory is writable. 367161847f8eSopenharmony_ci * 367261847f8eSopenharmony_ci * @type { number } 367361847f8eSopenharmony_ci * @default 2 367461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 367561847f8eSopenharmony_ci * @since 8 367661847f8eSopenharmony_ci */ 367761847f8eSopenharmony_ci PROT_WRITE: number; 367861847f8eSopenharmony_ci 367961847f8eSopenharmony_ci /** 368061847f8eSopenharmony_ci * Creates an Ashmem object with the specified name and size. 368161847f8eSopenharmony_ci * 368261847f8eSopenharmony_ci * @param { string } name - Name of the Ashmem object to create. 368361847f8eSopenharmony_ci * @param { number } size - Size (in bytes) of the Ashmem object to create. 368461847f8eSopenharmony_ci * @returns { Ashmem } Return the Ashmem object if it is created successfully; return null otherwise. 368561847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 368661847f8eSopenharmony_ci * @since 8 368761847f8eSopenharmony_ci * @deprecated since 9 368861847f8eSopenharmony_ci * @useinstead ohos.rpc.Ashmem#create 368961847f8eSopenharmony_ci */ 369061847f8eSopenharmony_ci static createAshmem(name: string, size: number): Ashmem; 369161847f8eSopenharmony_ci 369261847f8eSopenharmony_ci /** 369361847f8eSopenharmony_ci * Creates an Ashmem object with the specified name and size. 369461847f8eSopenharmony_ci * 369561847f8eSopenharmony_ci * @param { string } name - Name of the Ashmem object to create. 369661847f8eSopenharmony_ci * @param { number } size - Size (in bytes) of the Ashmem object to create. 369761847f8eSopenharmony_ci * @returns { Ashmem } Return the Ashmem object if it is created successfully; return null otherwise. 369861847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 369961847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 370061847f8eSopenharmony_ci * 2.The parameter type does not match; 370161847f8eSopenharmony_ci * 3.The Ashmem name passed is empty; 370261847f8eSopenharmony_ci * 4.The Ashmem size passed is less than or equal to 0. 370361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 370461847f8eSopenharmony_ci * @since 9 370561847f8eSopenharmony_ci */ 370661847f8eSopenharmony_ci static create(name: string, size: number): Ashmem; 370761847f8eSopenharmony_ci 370861847f8eSopenharmony_ci /** 370961847f8eSopenharmony_ci * Creates an Ashmem object by copying the file descriptor (FD) of an existing Ashmem object. 371061847f8eSopenharmony_ci * The two Ashmem objects point to the same shared memory region. 371161847f8eSopenharmony_ci * 371261847f8eSopenharmony_ci * @param { Ashmem } ashmem - Existing Ashmem object. 371361847f8eSopenharmony_ci * @returns { Ashmem } Ashmem object created. 371461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 371561847f8eSopenharmony_ci * @since 8 371661847f8eSopenharmony_ci * @deprecated since 9 371761847f8eSopenharmony_ci * @useinstead ohos.rpc.Ashmem#create 371861847f8eSopenharmony_ci */ 371961847f8eSopenharmony_ci static createAshmemFromExisting(ashmem: Ashmem): Ashmem; 372061847f8eSopenharmony_ci 372161847f8eSopenharmony_ci /** 372261847f8eSopenharmony_ci * Creates an Ashmem object by copying the file descriptor (FD) of an existing Ashmem object. 372361847f8eSopenharmony_ci * The two Ashmem objects point to the same shared memory region. 372461847f8eSopenharmony_ci * 372561847f8eSopenharmony_ci * @param { Ashmem } ashmem - Existing Ashmem object. 372661847f8eSopenharmony_ci * @returns { Ashmem } Ashmem object created. 372761847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 372861847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 372961847f8eSopenharmony_ci * 2.The passed parameter is not an Ahmem object; 373061847f8eSopenharmony_ci * 3.The ashmem instance for obtaining packaging is empty. 373161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 373261847f8eSopenharmony_ci * @since 9 373361847f8eSopenharmony_ci */ 373461847f8eSopenharmony_ci static create(ashmem: Ashmem): Ashmem; 373561847f8eSopenharmony_ci 373661847f8eSopenharmony_ci /** 373761847f8eSopenharmony_ci * Closes this Ashmem object. 373861847f8eSopenharmony_ci * 373961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 374061847f8eSopenharmony_ci * @since 8 374161847f8eSopenharmony_ci */ 374261847f8eSopenharmony_ci closeAshmem(): void; 374361847f8eSopenharmony_ci 374461847f8eSopenharmony_ci /** 374561847f8eSopenharmony_ci * Deletes the mappings for the specified address range of this Ashmem object. 374661847f8eSopenharmony_ci * 374761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 374861847f8eSopenharmony_ci * @since 8 374961847f8eSopenharmony_ci */ 375061847f8eSopenharmony_ci unmapAshmem(): void; 375161847f8eSopenharmony_ci 375261847f8eSopenharmony_ci /** 375361847f8eSopenharmony_ci * Obtains the mapped memory size of this Ashmem object. 375461847f8eSopenharmony_ci * 375561847f8eSopenharmony_ci * @returns { number } Memory size mapped. 375661847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 375761847f8eSopenharmony_ci * @since 8 375861847f8eSopenharmony_ci */ 375961847f8eSopenharmony_ci getAshmemSize(): number; 376061847f8eSopenharmony_ci 376161847f8eSopenharmony_ci /** 376261847f8eSopenharmony_ci * Creates the shared file mapping on the virtual address space of this process. 376361847f8eSopenharmony_ci * The size of the mapping region is specified by this Ashmem object. 376461847f8eSopenharmony_ci * 376561847f8eSopenharmony_ci * @param { number } mapType - Protection level of the memory region to which the shared file is mapped. 376661847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the operation is successful; return {@code false} otherwise. 376761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 376861847f8eSopenharmony_ci * @since 8 376961847f8eSopenharmony_ci * @deprecated since 9 377061847f8eSopenharmony_ci * @useinstead ohos.rpc.Ashmem#mapTypedAshmem 377161847f8eSopenharmony_ci */ 377261847f8eSopenharmony_ci mapAshmem(mapType: number): boolean; 377361847f8eSopenharmony_ci 377461847f8eSopenharmony_ci /** 377561847f8eSopenharmony_ci * Creates the shared file mapping on the virtual address space of this process. 377661847f8eSopenharmony_ci * The size of the mapping region is specified by this Ashmem object. 377761847f8eSopenharmony_ci * 377861847f8eSopenharmony_ci * @param { number } mapType - Protection level of the memory region to which the shared file is mapped. 377961847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 378061847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 378161847f8eSopenharmony_ci * 2.The parameter type does not match; 378261847f8eSopenharmony_ci * 3.The passed mapType exceeds the maximum protection level. 378361847f8eSopenharmony_ci * @throws { BusinessError } 1900001 - Failed to call mmap. 378461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 378561847f8eSopenharmony_ci * @since 9 378661847f8eSopenharmony_ci */ 378761847f8eSopenharmony_ci mapTypedAshmem(mapType: number): void; 378861847f8eSopenharmony_ci 378961847f8eSopenharmony_ci /** 379061847f8eSopenharmony_ci * Maps the shared file to the readable and writable virtual address space of the process. 379161847f8eSopenharmony_ci * 379261847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the operation is successful; return {@code false} otherwise. 379361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 379461847f8eSopenharmony_ci * @since 8 379561847f8eSopenharmony_ci * @deprecated since 9 379661847f8eSopenharmony_ci * @useinstead ohos.rpc.Ashmem#mapReadWriteAshmem 379761847f8eSopenharmony_ci */ 379861847f8eSopenharmony_ci mapReadAndWriteAshmem(): boolean; 379961847f8eSopenharmony_ci 380061847f8eSopenharmony_ci /** 380161847f8eSopenharmony_ci * Maps the shared file to the readable and writable virtual address space of the process. 380261847f8eSopenharmony_ci * 380361847f8eSopenharmony_ci * @throws { BusinessError } 1900001 - Failed to call mmap. 380461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 380561847f8eSopenharmony_ci * @since 9 380661847f8eSopenharmony_ci */ 380761847f8eSopenharmony_ci mapReadWriteAshmem(): void; 380861847f8eSopenharmony_ci 380961847f8eSopenharmony_ci /** 381061847f8eSopenharmony_ci * Maps the shared file to the read-only virtual address space of the process. 381161847f8eSopenharmony_ci * 381261847f8eSopenharmony_ci * @returns { boolean } Return {@code true} if the operation is successful; return {@code false} otherwise. 381361847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 381461847f8eSopenharmony_ci * @since 8 381561847f8eSopenharmony_ci * @deprecated since 9 381661847f8eSopenharmony_ci * @useinstead ohos.rpc.Ashmem#mapReadonlyAshmem 381761847f8eSopenharmony_ci */ 381861847f8eSopenharmony_ci mapReadOnlyAshmem(): boolean; 381961847f8eSopenharmony_ci 382061847f8eSopenharmony_ci /** 382161847f8eSopenharmony_ci * Maps the shared file to the read-only virtual address space of the process. 382261847f8eSopenharmony_ci * 382361847f8eSopenharmony_ci * @throws { BusinessError } 1900001 - Failed to call mmap. 382461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 382561847f8eSopenharmony_ci * @since 9 382661847f8eSopenharmony_ci */ 382761847f8eSopenharmony_ci mapReadonlyAshmem(): void; 382861847f8eSopenharmony_ci 382961847f8eSopenharmony_ci /** 383061847f8eSopenharmony_ci * Sets the protection level of the memory region to which the shared file is mapped. 383161847f8eSopenharmony_ci * 383261847f8eSopenharmony_ci * @param { number } protectionType - Protection type to set. 383361847f8eSopenharmony_ci * @returns { boolean } Return true if the operation is successful; return false otherwise. 383461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 383561847f8eSopenharmony_ci * @since 8 383661847f8eSopenharmony_ci * @deprecated since 9 383761847f8eSopenharmony_ci * @useinstead ohos.rpc.Ashmem#setProtectionType 383861847f8eSopenharmony_ci */ 383961847f8eSopenharmony_ci setProtection(protectionType: number): boolean; 384061847f8eSopenharmony_ci 384161847f8eSopenharmony_ci /** 384261847f8eSopenharmony_ci * Sets the protection level of the memory region to which the shared file is mapped. 384361847f8eSopenharmony_ci * 384461847f8eSopenharmony_ci * @param { number } protectionType - Protection type to set. 384561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 384661847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 384761847f8eSopenharmony_ci * 2.The parameter type does not match. 384861847f8eSopenharmony_ci * @throws { BusinessError } 1900002 - Failed to call ioctl. 384961847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 385061847f8eSopenharmony_ci * @since 9 385161847f8eSopenharmony_ci */ 385261847f8eSopenharmony_ci setProtectionType(protectionType: number): void; 385361847f8eSopenharmony_ci 385461847f8eSopenharmony_ci /** 385561847f8eSopenharmony_ci * Writes data to the shared file associated with this Ashmem object. 385661847f8eSopenharmony_ci * 385761847f8eSopenharmony_ci * @param { number[] } buf - Data to write. 385861847f8eSopenharmony_ci * @param { number } size - Size of the data to write. 385961847f8eSopenharmony_ci * @param { number } offset - Start position of the data to write in the memory region associated 386061847f8eSopenharmony_ci * with this Ashmem object. 386161847f8eSopenharmony_ci * @returns { boolean } Return {@code true} is the data is written successfully; return {@code false} otherwise. 386261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 386361847f8eSopenharmony_ci * @since 8 386461847f8eSopenharmony_ci * @deprecated since 9 386561847f8eSopenharmony_ci * @useinstead ohos.rpc.Ashmem#writeAshmem 386661847f8eSopenharmony_ci */ 386761847f8eSopenharmony_ci writeToAshmem(buf: number[], size: number, offset: number): boolean; 386861847f8eSopenharmony_ci 386961847f8eSopenharmony_ci /** 387061847f8eSopenharmony_ci * Writes data to the shared file associated with this Ashmem object. 387161847f8eSopenharmony_ci * 387261847f8eSopenharmony_ci * @param { number[] } buf - Data to write 387361847f8eSopenharmony_ci * @param { number } size - Size of the data to write 387461847f8eSopenharmony_ci * @param { number } offset - Start position of the data to write in the memory region associated 387561847f8eSopenharmony_ci * with this Ashmem object. 387661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 387761847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 387861847f8eSopenharmony_ci * 2.The parameter type does not match; 387961847f8eSopenharmony_ci * 3.The element does not exist in the array. 388061847f8eSopenharmony_ci * @throws { BusinessError } 1900003 - Failed to write data to the shared memory. 388161847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 388261847f8eSopenharmony_ci * @since 9 388361847f8eSopenharmony_ci * @deprecated since 11 388461847f8eSopenharmony_ci * @useinstead ohos.rpc.Ashmem#writeDataToAshmem 388561847f8eSopenharmony_ci */ 388661847f8eSopenharmony_ci writeAshmem(buf: number[], size: number, offset: number): void; 388761847f8eSopenharmony_ci 388861847f8eSopenharmony_ci /** 388961847f8eSopenharmony_ci * Writes data to the shared file associated with this Ashmem object. 389061847f8eSopenharmony_ci * 389161847f8eSopenharmony_ci * @param { ArrayBuffer } buf - Data to write 389261847f8eSopenharmony_ci * @param { number } size - Size of the data to write 389361847f8eSopenharmony_ci * @param { number } offset - Start position of the data to write in the memory region associated 389461847f8eSopenharmony_ci * with this Ashmem object. 389561847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 389661847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 389761847f8eSopenharmony_ci * 2.The parameter type does not match; 389861847f8eSopenharmony_ci * 3.Failed to obtain arrayBuffer information. 389961847f8eSopenharmony_ci * @throws { BusinessError } 1900003 - Failed to write data to the shared memory. 390061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 390161847f8eSopenharmony_ci * @since 11 390261847f8eSopenharmony_ci */ 390361847f8eSopenharmony_ci writeDataToAshmem(buf: ArrayBuffer, size: number, offset: number): void; 390461847f8eSopenharmony_ci 390561847f8eSopenharmony_ci /** 390661847f8eSopenharmony_ci * Reads data from the shared file associated with this Ashmem object. 390761847f8eSopenharmony_ci * 390861847f8eSopenharmony_ci * @param { number } size - Size of the data to read. 390961847f8eSopenharmony_ci * @param { number } offset - Start position of the data to read in the memory region associated 391061847f8eSopenharmony_ci * with this Ashmem object. 391161847f8eSopenharmony_ci * @returns { number[] } Data read. 391261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 391361847f8eSopenharmony_ci * @since 8 391461847f8eSopenharmony_ci * @deprecated since 9 391561847f8eSopenharmony_ci * @useinstead ohos.rpc.Ashmem#readAshmem 391661847f8eSopenharmony_ci */ 391761847f8eSopenharmony_ci readFromAshmem(size: number, offset: number): number[]; 391861847f8eSopenharmony_ci 391961847f8eSopenharmony_ci /** 392061847f8eSopenharmony_ci * Reads data from the shared file associated with this Ashmem object. 392161847f8eSopenharmony_ci * 392261847f8eSopenharmony_ci * @param { number } size - Size of the data to read. 392361847f8eSopenharmony_ci * @param { number } offset - Start position of the data to read in the memory region associated 392461847f8eSopenharmony_ci * with this Ashmem object. 392561847f8eSopenharmony_ci * @returns { number[] } Data read. 392661847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 392761847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 392861847f8eSopenharmony_ci * 2.The parameter type does not match. 392961847f8eSopenharmony_ci * @throws { BusinessError } 1900004 - Failed to read data from the shared memory. 393061847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 393161847f8eSopenharmony_ci * @since 9 393261847f8eSopenharmony_ci * @deprecated since 11 393361847f8eSopenharmony_ci * @useinstead ohos.rpc.Ashmem#readDataFromAshmem 393461847f8eSopenharmony_ci */ 393561847f8eSopenharmony_ci readAshmem(size: number, offset: number): number[]; 393661847f8eSopenharmony_ci 393761847f8eSopenharmony_ci /** 393861847f8eSopenharmony_ci * Reads data from the shared file associated with this Ashmem object. 393961847f8eSopenharmony_ci * 394061847f8eSopenharmony_ci * @param { number } size - Size of the data to read. 394161847f8eSopenharmony_ci * @param { number } offset - Start position of the data to read in the memory region associated 394261847f8eSopenharmony_ci * with this Ashmem object. 394361847f8eSopenharmony_ci * @returns { ArrayBuffer } Data read. 394461847f8eSopenharmony_ci * @throws { BusinessError } 401 - Parameter error. Possible causes: 394561847f8eSopenharmony_ci * 1.The number of parameters is incorrect; 394661847f8eSopenharmony_ci * 2.The parameter type does not match. 394761847f8eSopenharmony_ci * @throws { BusinessError } 1900004 - Failed to read data from the shared memory. 394861847f8eSopenharmony_ci * @syscap SystemCapability.Communication.IPC.Core 394961847f8eSopenharmony_ci * @since 11 395061847f8eSopenharmony_ci */ 395161847f8eSopenharmony_ci readDataFromAshmem(size: number, offset: number): ArrayBuffer; 395261847f8eSopenharmony_ci } 395361847f8eSopenharmony_ci} 395461847f8eSopenharmony_ci 395561847f8eSopenharmony_ciexport default rpc;