mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-08 03:24:04 +08:00
Reordered TermuxService.actionAcquireWakeLock()
This commit is contained in:
@@ -212,7 +212,11 @@ public final class TermuxService extends Service {
|
|||||||
/** Process action to acquire Power and Wi-Fi WakeLocks. */
|
/** Process action to acquire Power and Wi-Fi WakeLocks. */
|
||||||
@SuppressLint({"WakelockTimeout", "BatteryLife"})
|
@SuppressLint({"WakelockTimeout", "BatteryLife"})
|
||||||
private void actionAcquireWakeLock() {
|
private void actionAcquireWakeLock() {
|
||||||
if (mWakeLock == null) {
|
if (mWakeLock != null) {
|
||||||
|
Logger.logDebug(LOG_TAG, "Ignoring acquiring WakeLocks since they are already held");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.logDebug(LOG_TAG, "Acquiring WakeLocks");
|
Logger.logDebug(LOG_TAG, "Acquiring WakeLocks");
|
||||||
|
|
||||||
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||||
@@ -241,9 +245,7 @@ public final class TermuxService extends Service {
|
|||||||
updateNotification();
|
updateNotification();
|
||||||
|
|
||||||
Logger.logDebug(LOG_TAG, "WakeLocks acquired successfully");
|
Logger.logDebug(LOG_TAG, "WakeLocks acquired successfully");
|
||||||
} else {
|
|
||||||
Logger.logDebug(LOG_TAG, "Ignoring acquiring WakeLocks since they are already held");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Process action to release Power and Wi-Fi WakeLocks. */
|
/** Process action to release Power and Wi-Fi WakeLocks. */
|
||||||
|
Reference in New Issue
Block a user