Skip to content

Commit

Permalink
edit BootReceiver
Browse files Browse the repository at this point in the history
  • Loading branch information
romanvht committed Dec 15, 2024
1 parent 1fbec0b commit f9a2563
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.net.VpnService
import android.os.SystemClock
import io.github.dovecoteescapee.byedpi.data.Mode
import io.github.dovecoteescapee.byedpi.services.ServiceManager
import io.github.dovecoteescapee.byedpi.utility.getPreferences
Expand All @@ -15,6 +16,11 @@ class BootReceiver : BroadcastReceiver() {
intent.action == Intent.ACTION_REBOOT ||
intent.action == "android.intent.action.QUICKBOOT_POWERON") {

// for A15, todo: use wasForceStopped
if (SystemClock.elapsedRealtime() > 5 * 60 * 1000) {
return
}

val preferences = context.getPreferences()
val autorunEnabled = preferences.getBoolean("autostart", false)

Expand Down

0 comments on commit f9a2563

Please sign in to comment.