Skip to content

Commit

Permalink
make auto shutdown working again on android, max. time 600
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas committed May 20, 2024
1 parent a9b914d commit aec7a6d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void run() {
}
}
else{
state=service.getProcessState();
state=service.getProcessState(true);
}
if (state.isRunning){
pid.setText("running");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,10 @@ private boolean checkPermissions(boolean request){
}


public ProcessState getProcessState(){
lastTrigger=SystemClock.uptimeMillis();
public ProcessState getProcessState(boolean trigger){
if (trigger) {
lastTrigger = SystemClock.uptimeMillis();
}
if (processHandler != null) return processHandler.getState();
return new ProcessState();
}
Expand Down Expand Up @@ -537,7 +539,7 @@ void shutDown(){
stopSelf();
}
private void broadcastInfo(){
ProcessState pstate=getProcessState();
ProcessState pstate=getProcessState(false);
lastBroadcast=SystemClock.uptimeMillis();
//intentionally set lastBroadcaset before check to avoid error flood
if (!pstate.isRunning){
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<string name="s_shutdown">shutdown</string>
<integer name="s_shutdown_default">30</integer>
<integer name="s_shutdown_min">0</integer>
<integer name="s_shutdown_max">3600</integer>
<integer name="s_shutdown_max">600</integer>
<string name="s_memory">memory</string>
<integer name="s_memory_min">10</integer>
<integer name="s_memory_default">30</integer>
Expand Down

0 comments on commit aec7a6d

Please sign in to comment.