Code cleanup.

This commit is contained in:
akwizgran
2017-10-11 15:45:02 +01:00
parent c089a099f0
commit 74cfd313ab
2 changed files with 7 additions and 11 deletions

View File

@@ -35,16 +35,11 @@ public class RenewableWakeLock {
this.tag = tag;
this.duration = duration;
this.timeUnit = timeUnit;
renewTask = new Runnable() {
@Override
public void run() {
renew();
}
};
renewTask = this::renew;
}
public void acquire() {
if (LOG.isLoggable(INFO)) LOG.info("Acquiring wake lock " + tag );
if (LOG.isLoggable(INFO)) LOG.info("Acquiring wake lock " + tag);
synchronized (lock) {
if (wakeLock != null) {
LOG.info("Already acquired");
@@ -58,7 +53,7 @@ public class RenewableWakeLock {
}
private void renew() {
if (LOG.isLoggable(INFO)) LOG.info("Renewing wake lock " + tag );
if (LOG.isLoggable(INFO)) LOG.info("Renewing wake lock " + tag);
synchronized (lock) {
if (wakeLock == null) {
LOG.info("Already released");
@@ -74,7 +69,7 @@ public class RenewableWakeLock {
}
public void release() {
if (LOG.isLoggable(INFO)) LOG.info("Releasing wake lock " + tag );
if (LOG.isLoggable(INFO)) LOG.info("Releasing wake lock " + tag);
synchronized (lock) {
if (wakeLock == null) {
LOG.info("Already released");