See Also: Binder
public class Binder : Object, IBinder, IDisposable
Base class for a remotable object, the core part of a lightweight remote procedure call mechanism defined by BinderConsts. This class is an implementation of IBinder that provides standard local implementation of such an object.
Most developers will not implement this class directly, instead using the aidl tool to describe the desired interface, having it generate the appropriate Binder subclass. You can, however, derive directly from Binder to implement your own custom RPC protocol or simply instantiate a raw Binder object directly to use as a token that can be shared across processes.
This class is just a basic IPC primitive; it has no impact on an application's lifecycle, and is valid only as long as the process that created it continues to run. To use this correctly, you must be doing so within the context of a top-level application component (a Service, Activity, or ContentProvider) that lets the system know your process should remain running.
You must keep in mind the situations in which your process could go away, and thus require that you later re-create a new Binder and re-attach it when the process starts again. For example, if you are using this within an Activity, your activity's process may be killed any time the activity is not started; if the activity is later re-created you will need to create a new Binder and hand it back to the correct place again; you need to be aware that your process may be started for another reason (for example to receive a broadcast) that will not involve re-creating the activity and thus run its code to create a new Binder.
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1
The members of Android.OS.Binder are listed below.
See Also: Object
|Default constructor initializes the object.|
|CallingPid||Int32. Return the ID of the process that sent you the current transaction that is being processed.|
|CallingUid||Int32. Return the Linux uid assigned to the process that sent you the current transaction that is being processed.|
|CallingUserHandle||UserHandle. Return the UserHandle assigned to the process that sent you the current transaction that is being processed.|
|[read-only]||InterfaceDescriptor||String. Default implementation returns an empty interface name.|
|[read-only]||IsBinderAlive||Boolean. Check to see if the process that the binder is in is still alive.|
Convenience method for associating a specific interface with the Binder.
Reset the identity of the incoming IPC on the current thread.
Implemented to call the more convenient version Binder.Dump(FileDescriptor,PrintWriter,PrintWriter).
Like Binder.Dump(FileDescriptor,String), but ensures the target executes asynchronously.
Flush any Binder commands pending in the current thread to the kernel driver.
Add the calling thread to the IPC thread pool.
Local implementation is a no-op.
Default implementation always returns true -- if you got here, the object is alive.
Use information supplied to attachInterface() to return the associated IInterface if it matches the requested descriptor.
Restore the identity of the incoming IPC on the current thread back to a previously identity that was returned by Binder.ClearCallingIdentity.
|Transact(Int32, Parcel, Parcel, TransactionFlags)|
Default implementation rewinds the parcels and calls onTransact.
Local implementation is a no-op.