Package 

Class LeakSafeOneWayBinder

  • All Implemented Interfaces:
    android.os.IBinder

    @Internal() 
    public final class LeakSafeOneWayBinder
    extends Binder
                        

    An extension of Binder which delegates all transactions to an internal handler, and only supports one way transactions.

    Since Binder objects can be anchored forever by a misbehaved remote process, any references they hold can lead to significant memory leaks. To prevent that, the detach method clears the reference to the delegate handler, ensuring that only this simple class is leaked. Once detached, this binder returns false from any future transactions (and pings).

    Since two-way transactions block the calling thread on a remote process, this class only supports one-way calls.

    • Method Summary

      Modifier and Type Method Description
      void detach()
      boolean pingBinder()
      • Methods inherited from class android.os.Binder

        attachInterface, clearCallingIdentity, clearCallingWorkSource, dump, dumpAsync, flushPendingCommands, getCallingPid, getCallingUid, getCallingUidOrThrow, getCallingUserHandle, getCallingWorkSourceUid, getInterfaceDescriptor, isBinderAlive, joinThreadPool, linkToDeath, pingBinder, queryLocalInterface, restoreCallingIdentity, restoreCallingWorkSource, setCallingWorkSourceUid, transact, unlinkToDeath
      • Methods inherited from class android.os.IBinder

        getSuggestedMaxIpcSizeBytes
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait