Merge "Added more logs to track WakeLock usages" into nyc-dev

This commit is contained in:
Lifu Tang
2016-06-22 19:50:47 +00:00
committed by Android (Google) Code Review

View File

@@ -899,6 +899,7 @@ public class GnssLocationProvider implements LocationProviderInterface {
// hold wake lock while task runs // hold wake lock while task runs
mWakeLock.acquire(); mWakeLock.acquire();
Log.i(TAG, "WakeLock acquired by handleInjectNtpTime()");
AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() { AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
@@ -951,6 +952,7 @@ public class GnssLocationProvider implements LocationProviderInterface {
// release wake lock held by task // release wake lock held by task
mWakeLock.release(); mWakeLock.release();
Log.i(TAG, "WakeLock released by handleInjectNtpTime()");
} }
}); });
} }
@@ -969,6 +971,7 @@ public class GnssLocationProvider implements LocationProviderInterface {
// hold wake lock while task runs // hold wake lock while task runs
mWakeLock.acquire(); mWakeLock.acquire();
Log.i(TAG, "WakeLock acquired by handleDownloadXtraData()");
AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() { AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
@@ -991,6 +994,7 @@ public class GnssLocationProvider implements LocationProviderInterface {
// release wake lock held by task // release wake lock held by task
mWakeLock.release(); mWakeLock.release();
Log.i(TAG, "WakeLock released by handleDownloadXtraData()");
} }
}); });
} }
@@ -2040,6 +2044,7 @@ public class GnssLocationProvider implements LocationProviderInterface {
// note that this assumes the message will not be removed from the queue before // note that this assumes the message will not be removed from the queue before
// it is handled (otherwise the wake lock would be leaked). // it is handled (otherwise the wake lock would be leaked).
mWakeLock.acquire(); mWakeLock.acquire();
Log.i(TAG, "WakeLock acquired by sendMessage(" + message + ", " + arg + ", " + obj + ")");
mHandler.obtainMessage(message, arg, 1, obj).sendToTarget(); mHandler.obtainMessage(message, arg, 1, obj).sendToTarget();
} }
@@ -2099,6 +2104,8 @@ public class GnssLocationProvider implements LocationProviderInterface {
if (msg.arg2 == 1) { if (msg.arg2 == 1) {
// wakelock was taken for this message, release it // wakelock was taken for this message, release it
mWakeLock.release(); mWakeLock.release();
Log.i(TAG, "WakeLock released by handleMessage(" + message + ", " + msg.arg1 + ", "
+ msg.obj + ")");
} }
} }