mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-07 03:05:18 +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. */
|
||||
@SuppressLint({"WakelockTimeout", "BatteryLife"})
|
||||
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");
|
||||
|
||||
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||
@@ -241,9 +245,7 @@ public final class TermuxService extends Service {
|
||||
updateNotification();
|
||||
|
||||
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. */
|
||||
|
Reference in New Issue
Block a user