// hold wake lock while task runs
mWakeLock.acquire();
+ Log.i(TAG, "WakeLock acquired by handleInjectNtpTime()");
AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
@Override
public void run() {
// release wake lock held by task
mWakeLock.release();
+ Log.i(TAG, "WakeLock released by handleInjectNtpTime()");
}
});
}
// hold wake lock while task runs
mWakeLock.acquire();
+ Log.i(TAG, "WakeLock acquired by handleDownloadXtraData()");
AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
@Override
public void run() {
// release wake lock held by task
mWakeLock.release();
+ Log.i(TAG, "WakeLock released by handleDownloadXtraData()");
}
});
}
// note that this assumes the message will not be removed from the queue before
// it is handled (otherwise the wake lock would be leaked).
mWakeLock.acquire();
+ Log.i(TAG, "WakeLock acquired by sendMessage(" + message + ", " + arg + ", " + obj + ")");
mHandler.obtainMessage(message, arg, 1, obj).sendToTarget();
}
if (msg.arg2 == 1) {
// wakelock was taken for this message, release it
mWakeLock.release();
+ Log.i(TAG, "WakeLock released by handleMessage(" + message + ", " + msg.arg1 + ", "
+ + msg.obj + ")");
}
}