Binder Class

Definition

Base class for a remotable object, the core part of a lightweight remote procedure call mechanism defined by IBinder.

[Android.Runtime.Register("android/os/Binder", DoNotGenerateAcw=true)]
public class Binder : Java.Lang.Object, Android.OS.IBinder, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/os/Binder", DoNotGenerateAcw=true)>]
type Binder = class
    inherit Object
    interface IBinder
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
Binder
Attributes
Implements

Remarks

Java documentation for android.os.Binder.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Binder()

Default constructor just initializes the object.

Binder(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Binder(String)

Constructor for creating a raw Binder object (token) along with a descriptor.

Properties

CallingPid

Return the ID of the process that sent you the current transaction that is being processed.

CallingUid

Return the Linux uid assigned to the process that sent you the current transaction that is being processed.

CallingUidOrThrow

Return the Linux uid assigned to the process that sent the transaction currently being processed.

CallingUserHandle

Return the UserHandle assigned to the process that sent you the current transaction that is being processed.

CallingWorkSourceUid

Returns the work source set by the caller.

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
InterfaceDescriptor

Default implementation returns an empty interface name.

IsBinderAlive

To be added

        Note that if you're calling on a local binder, this always returns true
        because your process is alive if you're calling it.
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

AttachInterface(IInterface, String)

Convenience method for associating a specific interface with the Binder.

ClearCallingIdentity()

Reset the identity of the incoming IPC on the current thread.

ClearCallingWorkSource()

Clears the work source on this thread.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Dump(FileDescriptor, PrintWriter, String[])

Print the object's state into the given stream.

Dump(FileDescriptor, String[])

Implemented to call the more convenient version #dump(FileDescriptor, PrintWriter, String[]).

DumpAsync(FileDescriptor, String[])

Like #dump(FileDescriptor, String[]), but ensures the target executes asynchronously.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
FlushPendingCommands()

Flush any Binder commands pending in the current thread to the kernel driver.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
JoinThreadPool()

Add the calling thread to the IPC thread pool.

LinkToDeath(IBinderDeathRecipient, Int32)

Local implementation is a no-op.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
OnTransact(Int32, Parcel, Parcel, Int32)

Default implementation is a stub that returns false.

PingBinder()

Default implementation always returns true -- if you got here, the object is alive.

QueryLocalInterface(String)

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

RestoreCallingIdentity(Int64)

Restore the identity of the incoming IPC on the current thread back to a previously identity that was returned by #clearCallingIdentity.

RestoreCallingWorkSource(Int64)

Restores the work source on this thread using a token returned by #setCallingWorkSourceUid(int) or {@link clearCallingWorkSource().

SetCallingWorkSourceUid(Int32)

Sets the work source for this thread.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
Transact(Int32, Parcel, Parcel, TransactionFlags)

Default implementation rewinds the parcels and calls onTransact.

UnlinkToDeath(IBinderDeathRecipient, Int32)

Local implementation is a no-op.

UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until either another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object, or a specified amount of time has elapsed.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to