Build 1.0_r1(from source)

android.os
Class BinderProxy

java.lang.Object
  extended by android.os.BinderProxy
All Implemented Interfaces:
IBinder

final class BinderProxy
extends Object
implements IBinder


Nested Class Summary
 
Nested classes/interfaces inherited from interface android.os.IBinder
IBinder.DeathRecipient
 
Field Summary
 
Fields inherited from interface android.os.IBinder
DUMP_TRANSACTION, FIRST_CALL_TRANSACTION, FLAG_ONEWAY, INTERFACE_TRANSACTION, LAST_CALL_TRANSACTION, PING_TRANSACTION
 
Constructor Summary
BinderProxy()
           
 
Method Summary
protected  void finalize()
          Called by the virtual machine when there are no longer any (non-weak) references to the receiver.
 String getInterfaceDescriptor()
          Get the canonical name of the interface supported by this binder.
 boolean isBinderAlive()
          Check to see if the process that the binder is in is still alive.
 void linkToDeath(IBinder.DeathRecipient recipient, int flags)
          Register the recipient for a notification if this binder goes away.
 boolean pingBinder()
          Check to see if the object still exists.
 IInterface queryLocalInterface(String descriptor)
          Attempt to retrieve a local implementation of an interface for this Binder object.
 boolean transact(int code, Parcel data, Parcel reply, int flags)
          Perform a generic operation with the object.
 boolean unlinkToDeath(IBinder.DeathRecipient recipient, int flags)
          Remove a previously registered death notification.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinderProxy

BinderProxy()
Method Detail

pingBinder

public boolean pingBinder()
Description copied from interface: IBinder
Check to see if the object still exists.

Specified by:
pingBinder in interface IBinder
Returns:
Returns false if the hosting process is gone, otherwise the result (always by default true) returned by the pingBinder() implementation on the other side.

isBinderAlive

public boolean isBinderAlive()
Description copied from interface: IBinder
Check to see if the process that the binder is in is still alive.

Specified by:
isBinderAlive in interface IBinder
Returns:
false if the process is not alive. Note that if it returns true, the process may have died while the call is returning.

queryLocalInterface

public IInterface queryLocalInterface(String descriptor)
Description copied from interface: IBinder
Attempt to retrieve a local implementation of an interface for this Binder object. If null is returned, you will need to instantiate a proxy class to marshall calls through the transact() method.

Specified by:
queryLocalInterface in interface IBinder

getInterfaceDescriptor

public String getInterfaceDescriptor()
                              throws RemoteException
Description copied from interface: IBinder
Get the canonical name of the interface supported by this binder.

Specified by:
getInterfaceDescriptor in interface IBinder
Throws:
RemoteException

transact

public boolean transact(int code,
                        Parcel data,
                        Parcel reply,
                        int flags)
                 throws RemoteException
Description copied from interface: IBinder
Perform a generic operation with the object.

Specified by:
transact in interface IBinder
Parameters:
code - The action to perform. This should be a number between IBinder.FIRST_CALL_TRANSACTION and IBinder.LAST_CALL_TRANSACTION.
data - Marshalled data to send to the target. Most not be null. If you are not sending any data, you must create an empty Parcel that is given here.
reply - Marshalled data to be received from the target. May be null if you are not interested in the return value.
flags - Additional operation flags. Either 0 for a normal RPC, or IBinder.FLAG_ONEWAY for a one-way RPC.
Throws:
RemoteException

linkToDeath

public void linkToDeath(IBinder.DeathRecipient recipient,
                        int flags)
                 throws RemoteException
Description copied from interface: IBinder
Register the recipient for a notification if this binder goes away. If this binder object unexpectedly goes away (typically because its hosting process has been killed), then the given IBinder.DeathRecipient's DeathRecipient.binderDied() method will be called.

You will only receive death notifications for remote binders, as local binders by definition can't die without you dying as well.

Specified by:
linkToDeath in interface IBinder
Throws:
RemoteException
See Also:
IBinder.unlinkToDeath(android.os.IBinder.DeathRecipient, int)

unlinkToDeath

public boolean unlinkToDeath(IBinder.DeathRecipient recipient,
                             int flags)
Description copied from interface: IBinder
Remove a previously registered death notification. The recipient will no longer be called if this object dies.

Specified by:
unlinkToDeath in interface IBinder
Returns:
Returns true if the recipient is successfully unlinked, assuring you that its DeathRecipient.binderDied() method will not be called. Returns false if the target IBinder has already died, meaning the method has been (or soon will be) called.

finalize

protected void finalize()
                 throws Throwable
Description copied from class: Object
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. Subclasses can use this facility to guarantee that any associated resources are cleaned up before the receiver is garbage collected. Uncaught exceptions which are thrown during the running of the method cause it to terminate immediately, but are otherwise ignored.

Note: The virtual machine assumes that the implementation in class Object is empty.

Overrides:
finalize in class Object
Throws:
Throwable - The virtual machine ignores any exceptions which are thrown during finalization.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature