mirror of https://github.com/x13a/Wasted.git
ref
This commit is contained in:
parent
a173ffd83c
commit
33a6681052
|
@ -7,9 +7,9 @@ import androidx.core.content.ContextCompat
|
||||||
|
|
||||||
class RestartReceiver : BroadcastReceiver() {
|
class RestartReceiver : BroadcastReceiver() {
|
||||||
override fun onReceive(context: Context?, intent: Intent?) {
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
if (context == null || intent == null) return
|
if (context == null
|
||||||
if (intent.action != Intent.ACTION_BOOT_COMPLETED &&
|
|| (intent?.action != Intent.ACTION_BOOT_COMPLETED
|
||||||
intent.action != Intent.ACTION_MY_PACKAGE_REPLACED) return
|
&& intent?.action != Intent.ACTION_MY_PACKAGE_REPLACED)) return
|
||||||
val prefs = Preferences(context)
|
val prefs = Preferences(context)
|
||||||
if (!prefs.isServiceEnabled || !prefs.isWipeOnInactivity) return
|
if (!prefs.isServiceEnabled || !prefs.isWipeOnInactivity) return
|
||||||
ContextCompat.startForegroundService(
|
ContextCompat.startForegroundService(
|
||||||
|
|
Loading…
Reference in New Issue