public class IPCSkeleton extends Object
| 构造器 | 说明 |
|---|---|
IPCSkeleton() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static int |
flushCommands(IRemoteObject object) |
Flushes all pending commands from a specified
RemoteProxy to the corresponding RemoteObject. |
static String |
getCallingDeviceID() |
Obtains the ID of the device where the peer process resides.
|
static int |
getCallingPid() |
Obtains the PID of a proxy.
|
static int |
getCallingUid() |
Obtains the UID of a proxy.
|
static IRemoteObject |
getContextObject() |
Obtains a local
IRemoteObject reference of a registered service. |
static String |
getLocalDeviceID() |
Obtains the ID of the local device.
|
static boolean |
isLocalCalling() |
Checks whether a call is made on the same device.
|
static String |
resetCallingIdentity() |
Replaces the UID and PID of the remote user with those of the local user.
|
static boolean |
setCallingIdentity(String identity) |
Restores the UID and PID to those of the remote user.
|
public static IRemoteObject getContextObject()
IRemoteObject reference of a registered service.
This method is static.
IRemoteObject reference of the registered service.public static int getCallingPid()
This method is static. The PID is a positive integer during the communication between
the RemoteProxy object and RemoteObject object, and resumes to 0
when the communication ends. If this method is called from the RemoteProxy object,
0 is returned; if this method is called from the RemoteObject object,
the PID of the corresponding RemoteProxy object is returned.
public static int getCallingUid()
This method is static. The UID is a positive integer during the communication between
the RemoteProxy object and RemoteObject object, and resumes to 0
when the communication ends. If this method is called from the RemoteProxy object,
0 is returned; if this method is called from the RemoteObject object,
the UID of the corresponding RemoteProxy object is returned.
public static String getCallingDeviceID()
This method is static.
public static String getLocalDeviceID()
This method is static.
public static boolean isLocalCalling()
This method is static.
true if the call is made on the same device; returns false otherwise.public static int flushCommands(IRemoteObject object)
RemoteProxy to the corresponding RemoteObject.
This method is static. You are advised to call this method before performing any time-sensitive operations.
object - Indicates the specified RemoteProxy.0 if the operation succeeds; returns an error code if the input object is empty
or RemoteObject, or the operation fails.public static String resetCallingIdentity()
This method is static. It can be used in scenarios like authentication.
public static boolean setCallingIdentity(String identity)
This method is static. It is usually called after resetCallingIdentity is used
and requires the UID and PID of the remote user returned by resetCallingIdentity.
identity - Indicates the string containing the UID and PID of the remote user,
which is returned by resetCallingIdentity.true if the operation succeeds; returns false otherwise.