Refactored wake lock release.

This commit is contained in:
Dennis Guse
2020-01-05 18:44:15 +01:00
parent f6a27a1522
commit b5bf3aadc5
2 changed files with 14 additions and 9 deletions
@@ -99,4 +99,16 @@ public class SystemUtils {
}
return wakeLock;
}
/**
* Releases the wake lock if it is held.
*
* @return null
*/
public static WakeLock releaseWakeLock(WakeLock wakeLock) {
if (wakeLock != null && wakeLock.isHeld()) {
wakeLock.release();
}
return null;
}
}