From c41a0a49791152f2bb44cd12c76327719b1b58a3 Mon Sep 17 00:00:00 2001 From: lixiaoying25 Date: Fri, 12 Sep 2025 10:37:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B3=A8=E9=87=8A=E8=B0=83?= =?UTF-8?q?=E6=95=B4=EF=BC=8C=E8=AF=B4=E6=98=8E=E6=96=B9=E6=B3=95=E7=9A=84?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lixiaoying25 --- api/@ohos.rpc.d.ts | 52 ++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 786e16f153..2b4622f2bd 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -3170,7 +3170,9 @@ declare namespace rpc { ): void; /** - * Obtains the PID of the {@link RemoteProxy} object. + * Obtains the PID of the caller. + *

This API must be called within an IPC context (onRemoteRequest/onRemoteMessagerequest). Any asynchronous + * operations (for exaple, using await) are strictly prohibited before calling this API. * * @returns { number } Return the PID of the {@link RemoteProxy} object. * @syscap SystemCapability.Communication.IPC.Core @@ -3179,7 +3181,9 @@ declare namespace rpc { getCallingPid(): number; /** - * Obtains the UID of the {@link RemoteProxy} object. + * Obtains the UID of the caller. + *

This API must be called within an IPC context (onRemoteRequest/onRemoteMessagerequest). Any asynchronous + * operations (for exaple, using await) are strictly prohibited before calling this API. * * @returns { number } Return the UID of the {@link RemoteProxy} object. * @syscap SystemCapability.Communication.IPC.Core @@ -3551,12 +3555,10 @@ declare namespace rpc { static getContextObject(): IRemoteObject; /** - * Obtains the PID of a proxy. - *

This method is static. The PID is a positive integer during the communication between - * the {@link RemoteProxy} object and {@link RemoteObject} object, and resumes to {@code 0} - * when the communication ends. If this method is called from the {@link RemoteProxy} object, - * {@code 0} is returned; if this method is called from the {@link RemoteObject} object, - * the PID of the corresponding {@link RemoteProxy} object is returned. + * Obtains the PID of the caller. + *

This API is a static method that must be called within an IPC context + * (onRemoteRequest/onRemoteMessagerequest); otherwise, the PID of the process will be returned. Any asynchronous + * operations (for exaple, using await) are strictly prohibited before calling this API. * * @returns { number } Return the PID of the proxy. * @syscap SystemCapability.Communication.IPC.Core @@ -3565,12 +3567,10 @@ declare namespace rpc { static getCallingPid(): number; /** - * Obtains the UID of a proxy. - *

This method is static. The UID is a positive integer during the communication between - * the {@link RemoteProxy} object and {@link RemoteObject} object, and resumes to {@code 0} - * when the communication ends. If this method is called from the {@link RemoteProxy} object, - * {@code 0} is returned; if this method is called from the {@link RemoteObject} object, - * the UID of the corresponding {@link RemoteProxy} object is returned. + * Obtains the UID of the caller. + *

This API is a static method that must be called within an IPC context + * (onRemoteRequest/onRemoteMessagerequest); otherwise, the UID of the process will be returned. Any asynchronous + * operations (for exaple, using await) are strictly prohibited before calling this API. * * @returns { number } Return the UID of the proxy. * @syscap SystemCapability.Communication.IPC.Core @@ -3579,8 +3579,10 @@ declare namespace rpc { static getCallingUid(): number; /** - * Obtains the TOKENID. - *

This method is static. + * Obtains the TokenId of the caller. + *

This API is a static method that must be called within an IPC context + * (onRemoteRequest/onRemoteMessagerequest). Any asynchronous operations (for exaple, using await) are + * strictly prohibited before calling this API. * * @returns { number } Return the TOKENID. * @syscap SystemCapability.Communication.IPC.Core @@ -3589,8 +3591,10 @@ declare namespace rpc { static getCallingTokenId(): number; /** - * Obtains the ID of the device where the peer process resides. - *

This method is static. + * Obtains the device ID of the caller. + *

This API is a static method that must be called within an IPC context + * (onRemoteRequest/onRemoteMessagerequest). Any asynchronous operations (for exaple, using await) are + * strictly prohibited before calling this API. * * @returns { string } Return the ID of the device where the peer process resides. * @syscap SystemCapability.Communication.IPC.Core @@ -3599,8 +3603,10 @@ declare namespace rpc { static getCallingDeviceID(): string; /** - * Obtains the ID of the local device. - *

This method is static. + * Obtains the local device ID. + *

This API is a static method that must be called within an IPC context + * (onRemoteRequest/onRemoteMessagerequest). Any asynchronous operations (for exaple, using await) are + * strictly prohibited before calling this API. * * @returns { string } Return the ID of the local device. * @syscap SystemCapability.Communication.IPC.Core @@ -3609,8 +3615,10 @@ declare namespace rpc { static getLocalDeviceID(): string; /** - * Checks whether a call is made on the same device. - *

This method is static. + * Checks whether the peer process is a process of the local device. + *

This API is a static method that must be called within an IPC context + * (onRemoteRequest/onRemoteMessagerequest). Any asynchronous operations (for exaple, using await) are + * strictly prohibited before calling this API. * * @returns { boolean } Return {@code true} if the call is made on the same device; return {@code false} otherwise. * @syscap SystemCapability.Communication.IPC.Core -- Gitee