public class

Binder

extends Object
implements IBinder
java.lang.Object
   ↳ mindroid.os.Binder

Class Overview

Base class for a remotable object, the core part of a lightweight remote procedure call mechanism defined by IBinder. This class is an implementation of IBinder that provides the standard support creating a local implementation of such an object. You can 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.

See Also

Summary

[Expand]
Inherited Constants
From interface mindroid.os.IBinder
Public Constructors
Binder()
Public Methods
void attachInterface(IInterface owner, String descriptor)
Convenience method for associating a specific interface with the Binder.
String getInterfaceDescriptor()
Default implementation returns an empty interface name.
IInterface queryLocalInterface(String descriptor)
Use information supplied to attachInterface() to return the associated IInterface if it matches the requested descriptor.
boolean runsOnSameThread()
Object transact(int what, int arg1, int arg2, Object obj, int flags)
Object transact(int what, Object obj, int flags)
Object transact(int what, int flags)
Default implementations rewinds the parcels and calls onTransact.
Object transact(int what, int arg1, int arg2, int flags)
Object transact(int what, int arg1, int arg2, Bundle data, int flags)
Object transact(int what, Bundle data, int flags)
Protected Methods
Object onTransact(int what, int arg1, int arg2, Object obj, Bundle data)
Default implementation is a stub that returns null.
[Expand]
Inherited Methods
From class java.lang.Object
From interface mindroid.os.IBinder

Public Constructors

public Binder ()

Public Methods

public void attachInterface (IInterface owner, String descriptor)

Convenience method for associating a specific interface with the Binder. After calling, queryInterface() will be implemented for you to return the given owner IInterface when the corresponding descriptor is requested.

public String getInterfaceDescriptor ()

Default implementation returns an empty interface name.

public IInterface queryLocalInterface (String descriptor)

Use information supplied to attachInterface() to return the associated IInterface if it matches the requested descriptor.

public boolean runsOnSameThread ()

public Object transact (int what, int arg1, int arg2, Object obj, int flags)

public Object transact (int what, Object obj, int flags)

public Object transact (int what, int flags)

Default implementations rewinds the parcels and calls onTransact. On the remote side, transact calls into the binder to do the IPC.

Parameters
what The action to perform.
flags Additional operation flags. Either 0 for a normal RPC, or FLAG_ONEWAY for a one-way RPC.
Returns
  • data to be received from the target. May be null if you are not interested in the return value.

public Object transact (int what, int arg1, int arg2, int flags)

public Object transact (int what, int arg1, int arg2, Bundle data, int flags)

public Object transact (int what, Bundle data, int flags)

Protected Methods

protected Object onTransact (int what, int arg1, int arg2, Object obj, Bundle data)

Default implementation is a stub that returns null. You will want to override this to do the appropriate unmarshalling of transactions.

If you want to call this, call transact().