* commit 'd26ec600f162643554f7dee2ee9c24d74d412c88': Add a way to check whether we have a wakelock.
This commit is contained in:
commit
84f848f04e
@ -980,6 +980,12 @@ public abstract class SyncManager extends Service implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean hasWakeLock(long id) {
|
||||||
|
synchronized (mWakeLocks) {
|
||||||
|
return mWakeLocks.get(id) != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void acquireWakeLock(long id) {
|
private void acquireWakeLock(long id) {
|
||||||
synchronized (mWakeLocks) {
|
synchronized (mWakeLocks) {
|
||||||
Long lock = mWakeLocks.get(id);
|
Long lock = mWakeLocks.get(id);
|
||||||
@ -1075,6 +1081,14 @@ public abstract class SyncManager extends Service implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public boolean isHoldingWakeLock(long id) {
|
||||||
|
SyncManager ssm = INSTANCE;
|
||||||
|
if (ssm != null) {
|
||||||
|
return ssm.hasWakeLock(id);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static public void runAwake(long id) {
|
static public void runAwake(long id) {
|
||||||
SyncManager ssm = INSTANCE;
|
SyncManager ssm = INSTANCE;
|
||||||
if (ssm != null) {
|
if (ssm != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user