InstallerCallback, LocalRemoteObject, NfcController.ReaderModeCallbackStub, OnPermissionChangedCallback, RemoteObject, RemoteProxypublic interface IRemoteObject
This interface can be used to query or obtain an interface descriptor, add or remove a death notification, dump object status to a specific file, and send messages.
| 限定符和类型 | 接口 | 说明 |
|---|---|---|
static interface |
IRemoteObject.DeathRecipient |
Represents an inner class of
IRemoteObject that subscribes to death notifications of
a RemoteObject. |
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
DUMP_TRANSACTION |
Indicates the message code for a dump operation.
|
static int |
INTERFACE_TRANSACTION |
Indicates the message code for a transmission.
|
static int |
MAX_TRANSACTION_ID |
Indicates the maximum value of a valid message code.
|
static int |
MIN_TRANSACTION_ID |
Indicates the minimum value of a valid message code.
|
static int |
PING_TRANSACTION |
Indicates the message code for a Ping operation.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
addDeathRecipient(IRemoteObject.DeathRecipient recipient,
int flags) |
Registers a callback used to receive notifications of the death of a remote object.
|
void |
dump(FileDescriptor fd,
String[] args) |
Dumps object status to a specific file.
|
String |
getInterfaceDescriptor() |
Obtains the interface descriptor of an object.
|
boolean |
isObjectDead() |
Checks whether an object is dead.
|
IRemoteBroker |
queryLocalInterface(String descriptor) |
Queries the description of an interface.
|
boolean |
removeDeathRecipient(IRemoteObject.DeathRecipient recipient,
int flags) |
Deregisters a callback used to receive notifications of the death of a remote object.
|
boolean |
sendRequest(int code,
MessageParcel data,
MessageParcel reply,
MessageOption option) |
Sends a
MessageParcel message to the peer process in synchronous or asynchronous mode. |
void |
slowPathDump(FileDescriptor fd,
String[] args) |
Asynchronously dumps data to a specified file.
|
static final int DUMP_TRANSACTION
static final int INTERFACE_TRANSACTION
static final int MAX_TRANSACTION_ID
This constant is used to check the validity of an operation.
static final int MIN_TRANSACTION_ID
This constant is used to check the validity of an operation.
static final int PING_TRANSACTION
IRemoteBroker queryLocalInterface(String descriptor)
A valid IRemoteBroker object is returned for an interface used by the service provider;
null is returned for an interface used by the service user,
indicating that the interface is not a local one.
descriptor - Indicates a string of the interface descriptor.IRemoteBroker object bound to the specified interface descriptor.boolean sendRequest(int code,
MessageParcel data,
MessageParcel reply,
MessageOption option)
throws RemoteException
MessageParcel message to the peer process in synchronous or asynchronous mode.
If asynchronous mode is set for option, a response is returned immediately.
If synchronous mode is set for option, the interface will wait for a response from the peer process
until the request times out. The user must prepare reply for receiving the execution result
given by the peer process.
code - Indicates the message code, which is determined by both sides of the communication.
If the interface is generated by the IDL tool, the message code is automatically generated by IDL.data - Indicates the MessageParcel object sent to the peer process.reply - Indicates the MessageParcel object returned by the peer process.option - Indicates the synchronous or asynchronous mode to send messages.true if the method is called successfully; returns false otherwise.RemoteException - Throws this exception if the method fails to be called.boolean addDeathRecipient(IRemoteObject.DeathRecipient recipient, int flags)
This method is called if the remote object process matching the RemoteProxy object dies.
recipient - Indicates the callback to be registered.flags - Indicates the flag of the death notification.true if the callback is registered successfully; returns false otherwise.boolean removeDeathRecipient(IRemoteObject.DeathRecipient recipient, int flags)
recipient - Indicates the callback to be deregistered.flags - Indicates the flag of the death notification.true if the callback is deregistered successfully; returns false otherwise.String getInterfaceDescriptor()
The interface descriptor is a character string.
void dump(FileDescriptor fd, String[] args) throws RemoteException
fd - Indicates the descriptor of the target file.args - Indicates parameters of this method in character string format.RemoteException - Throws this exception if the dump fails.void slowPathDump(FileDescriptor fd, String[] args) throws RemoteException
This method applies only to data dump on the same device.
fd - Indicates the file descriptor of the target file.args - Indicates the arguments (an array of strings) to dump.RemoteException - Throws this exception if the dump command fails to be sent or
an error occurs during the dump.boolean isObjectDead()
true if the object is dead; returns false otherwise.