文档管理中心

您当前正在浏览HarmonyOS开发者3.0版本配套的开发者文档,对应API能力级别为API 8 Release。此版本文档已归档不再维护,推荐您使用HarmonyOS NEXT版本

API参考Java API参考ohos.ace.abilityInterfaceAceInternalAbility.AceInternalAbilityHandler

AceInternalAbility.AceInternalAbilityHandler

收起
自动换行
深色代码主题
复制
  1. public static interface AceInternalAbility.AceInternalAbilityHandler
Handles the requests from the local ability to call an internal ability.

Since:

3

Method Summary

展开

Modifier and Type

Method

Description

boolean

onRemoteRequest​(int code, MessageParcel data, MessageParcel reply, MessageOption option)

Called when an internal ability request is received from the local ability.

Method Detail

onRemoteRequest

boolean onRemoteRequest​(int code, MessageParcel data, MessageParcel reply, MessageOption option) throws RemoteException

Called when an internal ability request is received from the local ability. You can implement this method to process the request, such as calling, subscribing, and unsubscribing the internal ability.

You need to specify the service code and request data of the internal ability. The request data structures vary depending on the request types.

Before publishing your JavaScript APIs, ensure that the service codes and request data structures are forward-compatible.

Parameters:

展开

Parameter Name

Parameter Description

code

Indicates the service code sent from the JavaScript side. Note that the service code must be forward-compatible.

data

Indicates the request data, which is a MessageParcel object sent from the JavaScript side. Note that the JSON string representation of the object must be forward-compatible.

reply

Indicates the response message, which is a MessageParcel object returned by the local service. Currently, the value can only be a string or null.

option

Indicates whether the operation is synchronous or asynchronous.

Returns:

Returns true if the internal ability operation is successful; returns false otherwise.

Throws:

展开

Throw Name

Throw Description

RemoteException

Throws this exception if an error occurs during remote processing.

Since:

3

搜索
请输入您想要搜索的关键词