public abstract class TokenWatcher
extends Object
java.lang.Object | |
↳ | android.os.TokenWatcher |
助手类,帮助您使用IBinder对象作为引用计数令牌。 因为我们发现它们被删除时,IBinder会创建好的令牌
Public constructors |
|
---|---|
TokenWatcher(Handler h, String tag) 构建TokenWatcher |
Public methods |
|
---|---|
void |
acquire(IBinder token, String tag) 记录该令牌已被获取。 |
abstract void |
acquired() 当有效令牌的数量从0变为1时调用。 |
void |
cleanup(IBinder token, boolean unlink) |
void |
dump(PrintWriter pw) |
void |
dump() |
boolean |
isAcquired() |
void |
release(IBinder token) |
abstract void |
released() 当有效令牌的数量从1变为0时调用。 |
Inherited methods |
|
---|---|
From class java.lang.Object
|
TokenWatcher (Handler h, String tag)
构建TokenWatcher
Parameters | |
---|---|
h |
Handler : 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 |
String : A debugging tag for this TokenWatcher |
void acquire (IBinder token, String tag)
记录该令牌已被获取。 当调用获取并且当前计数为0时,获取的方法在给定的处理程序上调用。
Parameters | |
---|---|
token |
IBinder : An IBinder object. If this token has already been acquired, no action is taken. |
tag |
String : A string used by the dump() method for debugging, to see who has references. |
void cleanup (IBinder token, boolean unlink)
Parameters | |
---|---|
token |
IBinder
|
unlink |
boolean
|