public abstract class TokenWatcher extends Object
Constructor and Description |
---|
TokenWatcher(Handler h,
String tag)
Construct the TokenWatcher
|
Modifier and Type | Method and Description |
---|---|
void |
acquire(IBinder token,
String tag)
Record that this token has been acquired.
|
abstract void |
acquired()
Called when the number of active tokens goes from 0 to 1.
|
void |
cleanup(IBinder token,
boolean unlink) |
void |
dump() |
void |
dump(PrintWriter pw) |
boolean |
isAcquired() |
void |
release(IBinder token) |
abstract void |
released()
Called when the number of active tokens goes from 1 to 0.
|
public TokenWatcher(Handler h, String tag)
h
- A handler to call acquired()
and released()
on. If you don't care, just call it like this, although your thread
will have to be a Looper thread.
new TokenWatcher(new Handler())
tag
- A debugging tag for this TokenWatcherpublic abstract void acquired()
public abstract void released()
public void acquire(IBinder token, String tag)
token
- An IBinder object. If this token has already been acquired,
no action is taken.tag
- A string used by the dump()
method for debugging,
to see who has references.public void cleanup(IBinder token, boolean unlink)
public void release(IBinder token)
public boolean isAcquired()
public void dump()
public void dump(PrintWriter pw)