提交 29950b2e 编写于 作者: Y yangguangzhao

add syscap in js-apis-rpc.md

Signed-off-by: Nyangguangzhao <yangguangzhao1@huawei.com>
上级 1733bf33
......@@ -13,11 +13,6 @@ import rpc from '@ohos.rpc';
```
## 权限列表
## MessageParcel
该类提供读写基础类型及数组、IPC对象、接口描述符和自定义序列化对象的方法。
......@@ -29,6 +24,7 @@ create(): MessageParcel
静态方法,创建MessageParcel对象。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -49,6 +45,7 @@ reclaim(): void
释放不再使用的MessageParcel对象。
**系统能力**:SystemCapability.Communication.IPC.Core
- 示例
......@@ -63,6 +60,9 @@ reclaim(): void
writeRemoteObject(object: [IRemoteObject](#iremoteobject)): boolean
序列化远程对象并将其写入MessageParcel对象。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -93,6 +93,7 @@ readRemoteObject(): IRemoteObject
从MessageParcel读取远程对象。此方法用于反序列化MessageParcel对象以生成IRemoteObject。远程对象按写入MessageParcel的顺序读取。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -120,6 +121,7 @@ writeInterfaceToken(token: string): boolean
将接口描述符写入MessageParcel对象。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -146,6 +148,7 @@ readInterfaceToken(): string
从MessageParcel中读取接口描述符。接口描述符按写入MessageParcel的顺序读取。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -171,6 +174,7 @@ getSize(): number
获取当前MessageParcel的数据大小。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -192,6 +196,7 @@ getCapacity(): number
获取当前MessageParcel的容量。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -213,6 +218,7 @@ setSize(size: number): boolean
设置MessageParcel实例中包含的数据大小。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -239,6 +245,7 @@ setCapacity(size: number): boolean
设置MessageParcel实例的存储容量。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -265,6 +272,7 @@ getWritableBytes(): number
获取MessageParcel的可写字节空间。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -290,6 +298,7 @@ getReadableBytes(): number
获取MessageParcel的可读字节空间。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -315,6 +324,7 @@ getReadPosition(): number
获取MessageParcel的读位置。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -336,6 +346,7 @@ getWritePosition(): number
获取MessageParcel的写位置。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -358,6 +369,7 @@ rewindRead(pos: number): boolean
重新偏移读取位置到指定的位置。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -389,6 +401,7 @@ rewindWrite(pos: number): boolean
重新偏移写位置到指定的位置。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -418,6 +431,7 @@ writeByte(val: number): boolean
将字节值写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -444,6 +458,7 @@ readByte(): number
从MessageParcel实例读取字节值。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -467,6 +482,7 @@ writeShort(val: number): boolean
将短整数值写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -493,6 +509,7 @@ readShort(): number
从MessageParcel实例读取短整数值。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -516,6 +533,7 @@ writeInt(val: number): boolean
将整数值写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -542,6 +560,7 @@ readInt(): number
从MessageParcel实例读取整数值。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -565,6 +584,7 @@ writeLong(val: number): boolean
将长整数值写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -591,6 +611,7 @@ readLong(): number
从MessageParcel实例中读取长整数值。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -614,6 +635,7 @@ writeFloat(val: number): boolean
将浮点值写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -640,6 +662,7 @@ readFloat(): number
从MessageParcel实例中读取浮点值。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -663,6 +686,7 @@ writeDouble(val: number): boolean
将双精度浮点值写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -689,6 +713,7 @@ readDouble(): number
从MessageParcel实例读取双精度浮点值。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -712,6 +737,7 @@ writeBoolean(val: boolean): boolean
将布尔值写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -738,6 +764,7 @@ readBoolean(): boolean
从MessageParcel实例读取布尔值。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -761,6 +788,7 @@ writeChar(val: number): boolean
将单个字符值写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -787,6 +815,7 @@ readChar(): number
从MessageParcel实例中读取单个字符值。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -810,6 +839,7 @@ writeString(val: string): boolean
将字符串值写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -836,6 +866,7 @@ readString(): string
从MessageParcel实例读取字符串值。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -859,6 +890,7 @@ writeSequenceable(val: Sequenceable): boolean
将自定义序列化对象写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -902,6 +934,7 @@ readSequenceable(dataIn: Sequenceable) : boolean
从MessageParcel实例中读取成员变量到指定的对象(dataIn)。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -948,6 +981,7 @@ writeByteArray(byteArray: number[]): boolean
将字节数组写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -975,6 +1009,7 @@ readByteArray(dataIn: number[]) : void
从MessageParcel实例读取字节数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -999,6 +1034,7 @@ readByteArray(): number[]
从MessageParcel实例中读取字节数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -1023,6 +1059,7 @@ writeShortArray(shortArray: number[]): boolean
将短整数数组写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1049,6 +1086,7 @@ readShortArray(dataIn: number[]) : void
从MessageParcel实例中读取短整数数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1072,6 +1110,7 @@ readShortArray(): number[]
从MessageParcel实例中读取短整数数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -1095,6 +1134,7 @@ writeIntArray(intArray: number[]): boolean
将整数数组写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1121,6 +1161,7 @@ readIntArray(dataIn: number[]) : void
从MessageParcel实例中读取整数数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1144,6 +1185,7 @@ readIntArray(): number[]
从MessageParcel实例中读取整数数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -1167,6 +1209,7 @@ writeLongArray(longArray: number[]): boolean
将长整数数组写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1193,6 +1236,7 @@ readLongArray(dataIn: number[]) : void
从MessageParcel实例读取长整数数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1216,6 +1260,7 @@ readLongArray(): number[]
从MessageParcel实例中读取长整数数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -1239,6 +1284,7 @@ writeFloatArray(floatArray: number[]): boolean
将浮点数组写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1265,6 +1311,8 @@ readFloatArray(dataIn: number[]) : void
从MessageParcel实例中读取浮点数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -1288,6 +1336,7 @@ readFloatArray(): number[]
从MessageParcel实例中读取浮点数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -1311,6 +1360,7 @@ writeDoubleArray(doubleArray: number[]): boolean
将双精度浮点数组写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1337,6 +1387,7 @@ readDoubleArray(dataIn: number[]) : void
从MessageParcel实例中读取双精度浮点数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1360,6 +1411,7 @@ readDoubleArray(): number[]
从MessageParcel实例读取双精度浮点数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -1383,6 +1435,7 @@ writeBooleanArray(booleanArray: boolean[]): boolean
将布尔数组写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1409,6 +1462,7 @@ readBooleanArray(dataIn: boolean[]) : void
从MessageParcel实例中读取布尔数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1432,6 +1486,7 @@ readBooleanArray(): boolean[]
从MessageParcel实例中读取布尔数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -1454,6 +1509,7 @@ writeCharArray(charArray: number[]): boolean
将单个字符数组写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1480,6 +1536,7 @@ readCharArray(dataIn: boolean[]) : void
从MessageParcel实例中读取单个字符数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1503,6 +1560,7 @@ readCharArray(): boolean[]
从MessageParcel实例读取单个字符数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -1526,6 +1584,7 @@ writeStringArray(stringArray: string[]): boolean
将字符串数组写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1552,6 +1611,7 @@ readStringArray(dataIn: string[]) : void
从MessageParcel实例读取字符串数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1575,6 +1635,7 @@ readStringArray(): string[]
从MessageParcel实例读取字符串数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -1598,6 +1659,7 @@ writeNoException(): void
向MessageParcel写入“指示未发生异常”的信息。
**系统能力**:SystemCapability.Communication.IPC.Core
- 示例
......@@ -1626,6 +1688,7 @@ readException(): void
从MessageParcel中读取异常。
**系统能力**:SystemCapability.Communication.IPC.Core
- 示例
......@@ -1680,6 +1743,7 @@ writeSequenceableArray(sequenceableArray: Sequenceable[]): boolean
将可序列化对象数组写入MessageParcel实例。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1726,6 +1790,7 @@ readSequenceableArray(sequenceableArray: Sequenceable[]): void
从MessageParcel实例读取可序列化对象数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1769,6 +1834,7 @@ writeRemoteObjectArray(objectArray: IRemoteObject[]): boolean
将IRemoteObject对象数组写入MessageParcel。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1802,6 +1868,7 @@ readRemoteObjectArray(objects: IRemoteObject[]): void
从MessageParcel读取IRemoteObject对象数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1831,6 +1898,7 @@ readRemoteObjectArray(): IRemoteObject[]
从MessageParcel读取IRemoteObject对象数组。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -1861,6 +1929,7 @@ static closeFileDescriptor(fd: number): void
关闭给定的文件描述符。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1883,6 +1952,7 @@ static dupFileDescriptor(fd: number) :number
复制给定的文件描述符。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1910,6 +1980,7 @@ containFileDescriptors(): boolean
检查此MessageParcel对象是否包含文件描述符。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -1937,6 +2008,7 @@ writeFileDescriptor(fd: number): boolean
写入文件描述符到MessageParcel。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1966,6 +2038,7 @@ readFileDescriptor(): number
从MessageParcel中读取文件描述符。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -1991,6 +2064,7 @@ writeAshmem(ashmem: Ashmem): boolean
将指定的匿名共享对象写入此MessageParcel。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2018,6 +2092,7 @@ readAshmem(): Ashmem
从MessageParcel读取匿名共享对象。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -2042,6 +2117,7 @@ getRawDataCapacity(): number
获取MessageParcel可以容纳的最大原始数据量。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -2063,6 +2139,7 @@ writeRawData(rawData: number[], size: number): boolean
将原始数据写入MessageParcel对象。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2091,6 +2168,7 @@ readRawData(size: number): number[]
从MessageParcel读取原始数据。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2120,6 +2198,7 @@ getDataVersion(): number
从MessageParcel对象返回数据格式版本。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -2141,6 +2220,7 @@ updateDataVersion(proxy: IRemoteObject): void
将远程对象数据格式版本更新到MessageParcel对象。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2185,6 +2265,8 @@ marshalling(dataOut: MessageParcel): boolean
将此可序列对象封送到MessageParcel中。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -2230,6 +2312,8 @@ unmarshalling(dataIn: MessageParcel) : boolean
从MessageParcel中解封此可序列对象。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -2280,6 +2364,8 @@ asObject(): IRemoteObject
需派生类实现,获取代理或远端对象。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
| -------- | -------- |
......@@ -2320,6 +2406,8 @@ onRemoteDied(): void
在成功添加死亡通知订阅后,当远端对象死亡时,将自动调用本方法。
**系统能力**:SystemCapability.Communication.IPC.Core
- 示例
```
......@@ -2335,6 +2423,8 @@ onRemoteDied(): void
发送请求的响应结果。
**系统能力**:以下各项对应的系统能力均为SystemCapability.Communication.IPC.Core。
| 参数 | 值 | 说明 |
| -------- | -------- | -------- |
| errCode | number | 错误码。 |
......@@ -2354,6 +2444,8 @@ queryLocalInterface(descriptor: string): IRemoteBroker
查询接口。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -2373,6 +2465,8 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
以同步或异步方式向对端进程发送MessageParcel消息。如果为选项设置了异步模式,则期约立即兑现,reply报文里没有内容。如果为选项设置了同步模式,则期约将在sendRequest返回时兑现,回复内容在reply报文里。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -2393,6 +2487,8 @@ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: Me
以同步或异步方式向对端进程发送MessageParcel消息。如果为选项设置了异步模式,则立即收到回调,reply报文里没有内容。如果为选项设置了同步模式,则将在sendRequest返回时收到回调,回复内容在reply报文里。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -2409,6 +2505,8 @@ addDeathRecipient(recipient: DeathRecipient, flags: number): boolean
注册用于接收远程对象死亡通知的回调。如果与RemoteProxy对象匹配的远程对象进程死亡,则调用此方法。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -2427,6 +2525,8 @@ removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean
注销用于接收远程对象死亡通知的回调。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -2445,6 +2545,8 @@ getInterfaceDescriptor(): string
获取对象的接口描述符。接口描述符为字符串。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
| -------- | -------- |
......@@ -2457,6 +2559,8 @@ isObjectDead(): boolean
检查当前对象是否死亡。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
| -------- | -------- |
......@@ -2476,6 +2580,8 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
以同步或异步方式向对端进程发送MessageParcel消息。如果为选项设置了异步模式,则期约立即兑现,reply报文里没有内容。如果为选项设置了同步模式,则期约将在sendRequest返回时兑现,回复内容在reply报文里。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2588,6 +2694,7 @@ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: Me
以同步或异步方式向对端进程发送MessageParcel消息。如果为选项设置了异步模式,则立即收到回调,reply报文里没有内容。如果为选项设置了同步模式,则将在sendRequest返回时收到回调,回复内容在reply报文里。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2648,6 +2755,7 @@ queryLocalInterface(interface: string): IRemoteBroker
查询并获取当前接口描述符对应的本地接口对象。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2692,6 +2800,7 @@ addDeathRecipient(recipient : DeathRecipient, flags : number): boolean
注册用于接收远程对象死亡通知的回调,增加proxy对象上的死亡通知。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2742,6 +2851,7 @@ removeDeathRecipient(recipient : DeathRecipient, flags : number): boolean
注销用于接收远程对象死亡通知的回调。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2793,6 +2903,7 @@ getInterfaceDescriptor(): string
查询当前代理对象接口的描述符。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -2832,6 +2943,7 @@ isObjectDead(): boolean
指示对应的RemoteObject是否死亡。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -2871,6 +2983,7 @@ setDataVersion(dataVersion: number): boolean
将数据格式版本设置到RemoteProxy对象。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -2913,6 +3026,7 @@ setDataVersion(dataVersion: number): boolean
公共消息选项(int标志,int等待时间),使用标志中指定的标志构造指定的MessageOption对象。
**系统能力**:以下各项对应的系统能力均为SystemCapability.Communication.IPC.Core。
| 参数 | 值 | 说明 |
| -------- | -------- | -------- |
......@@ -2928,6 +3042,8 @@ constructor(syncFlags?: number, waitTime = TF_WAIT_TIME)
MessageOption构造函数。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -2941,6 +3057,7 @@ getFlags(): number
获取同步调用或异步调用标志。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -2954,6 +3071,8 @@ setFlags(flags: number): void
设置同步调用或异步调用标志。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -2966,6 +3085,8 @@ getWaitTime(): number
获取rpc调用的最长等待时间。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
| -------- | -------- |
......@@ -2978,6 +3099,8 @@ setWaitTime(waitTime: number): void
设置rpc调用最长等待时间。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -2995,6 +3118,7 @@ static getContextObject(): IRemoteObject
获取系统能力的管理者。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -3015,6 +3139,7 @@ static getCallingPid(): number
获取调用者的PID。此方法由RemoteObject对象在onRemoteRequest方法中调用,不在IPC上下文环境(onRemoteRequest)中调用则返回本进程的PID。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -3040,6 +3165,7 @@ static getCallingUid(): number
获取调用者的UID。此方法由RemoteObject对象在onRemoteRequest方法中调用,不在IPC上下文环境(onRemoteRequest)中调用则返回本进程的UID。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -3065,6 +3191,7 @@ static getCallingDeviceID(): string
获取调用者进程所在的设备ID。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -3090,6 +3217,7 @@ static getLocalDeviceID(): string
获取本端设备ID。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -3115,6 +3243,7 @@ static isLocalCalling(): boolean
检查当前通信对端是否是本设备的进程。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -3140,6 +3269,8 @@ static flushCommands(object : IRemoteObject): number
将所有挂起的命令从指定的RemoteProxy刷新到相应的RemoteObject。建议在执行任何时间敏感操作之前调用此方法。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -3166,6 +3297,7 @@ static resetCallingIdentity(): string
将远程用户的UID和PID替换为本地用户的UID和PID。它可以用于身份验证等场景。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -3191,6 +3323,8 @@ static setCallingIdentity(identity : string): boolean
将UID和PID恢复为远程用户的UID和PID。它通常在使用resetCallingIdentity后调用,需要resetCallingIdentity返回的远程用户的UID和PID。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -3231,6 +3365,8 @@ constructor(descriptor: string)
RemoteObject构造函数。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -3245,6 +3381,8 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options
以同步或异步方式向对端进程发送MessageParcel消息。如果为选项设置了异步模式,则期约立即兑现,reply报文里没有内容。如果为选项设置了同步模式,则期约将在sendRequest返回时兑现,回复内容在reply报文里。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -3332,6 +3470,8 @@ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: Me
以同步或异步方式向对端进程发送MessageParcel消息。如果为选项设置了异步模式,则立即收到回调,reply报文里没有内容。如果为选项设置了同步模式,则将在sendRequest返回时收到回调,回复内容在reply报文里。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -3379,6 +3519,8 @@ onRemoteRequest(code : number, data : MessageParcel, reply: MessageParcel, optio
sendRequest请求的响应处理函数,服务端在该函数里处理请求,回复结果。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -3420,6 +3562,8 @@ getCallingUid(): number
获取通信对端的进程Uid。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
| -------- | -------- |
......@@ -3445,6 +3589,8 @@ getCallingPid(): number
获取通信对端的进程Pid。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
| -------- | -------- |
......@@ -3470,6 +3616,8 @@ queryLocalInterface(descriptor: descriptor): IRemoteBroker
查询并获取当前接口描述符对应的远端对象是否已经存在。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -3500,6 +3648,8 @@ getInterfaceDescriptor(): string
查询接口描述符。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
| -------- | -------- |
......@@ -3526,6 +3676,8 @@ attachLocalInterface(localInterface: IRemoteBroker, descriptor: string): void
此接口用于把接口描述符和IRemoteBroker对象绑定。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -3552,6 +3704,8 @@ attachLocalInterface(localInterface: IRemoteBroker, descriptor: string): void
映射内存保护类型:
**系统能力**:以下各项对应的系统能力均为SystemCapability.Communication.IPC.Core。
| 参数名 | 值 | 说明 |
| -------- | -------- | -------- |
| PROT_EXEC | 4 | 映射的内存可执行 |
......@@ -3566,6 +3720,8 @@ static createAshmem(name: string, size: number): Ashmem
根据指定的名称和大小创建Ashmem对象。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -3593,6 +3749,8 @@ static createAshmemFromExisting(ashmem: Ashmem): Ashmem
通过复制现有Ashmem对象的文件描述符(fd)来创建Ashmem对象。两个Ashmem对象指向同一个共享内存区域。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......@@ -3620,6 +3778,7 @@ closeAshmem(): void
关闭这个Ashmem。
**系统能力**:SystemCapability.Communication.IPC.Core
- 示例
......@@ -3635,6 +3794,7 @@ unmapAshmem(): void
删除该Ashmem对象的地址映射。
**系统能力**:SystemCapability.Communication.IPC.Core
- 示例
......@@ -3650,6 +3810,7 @@ getAshmemSize(): number
获取Ashmem对象的内存大小。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -3671,6 +3832,7 @@ mapAshmem(mapType: number): boolean
在此进程的虚拟地址空间上创建共享文件映射,映射区域大小由此Ashmem对象指定。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3697,6 +3859,7 @@ mapReadAndWriteAshmem(): boolean
在此进程虚拟地址空间上创建可读写的共享文件映射。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -3718,6 +3881,7 @@ mapReadOnlyAshmem(): boolean
在此进程虚拟地址空间上创建只读的共享文件映射。
**系统能力**:SystemCapability.Communication.IPC.Core
- 返回值
| 类型 | 说明 |
......@@ -3739,6 +3903,7 @@ setProtection(protectionType: number): boolean
设置映射内存区域的保护等级。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3765,6 +3930,7 @@ writeToAshmem(buf: number[], size: number, offset: number): boolean
将数据写入此Ashmem对象关联的共享文件。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
......@@ -3794,6 +3960,8 @@ readFromAshmem(size: number, offset: number): number[]
从此Ashmem对象关联的共享文件中读取数据。
**系统能力**:SystemCapability.Communication.IPC.Core
- 参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册