mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-12-16 14:01:14 +01:00
Reordered TermuxService.actionAcquireWakeLock()
This commit is contained in:
parent
5d6a98452a
commit
7d53a147d8
1 changed files with 32 additions and 30 deletions
|
|
@ -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. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue