From 3956cbe2d20c062e6a2ba3c4fe53762c6c0b8788 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Mon, 14 Feb 2022 23:07:24 +0800 Subject: [PATCH] ActivityTracker ignore SuRequestActivity --- app/src/main/java/com/topjohnwu/magisk/core/App.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/com/topjohnwu/magisk/core/App.kt b/app/src/main/java/com/topjohnwu/magisk/core/App.kt index 5c57ef80e..afd9c1430 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/App.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/App.kt @@ -9,6 +9,7 @@ import android.os.Bundle import com.topjohnwu.magisk.StubApk import com.topjohnwu.magisk.core.utils.* import com.topjohnwu.magisk.di.ServiceLocator +import com.topjohnwu.magisk.ui.surequest.SuRequestActivity import com.topjohnwu.superuser.Shell import com.topjohnwu.superuser.internal.UiThreadHandler import com.topjohnwu.superuser.ipc.RootService @@ -94,10 +95,12 @@ object ActivityTracker : Application.ActivityLifecycleCallbacks { val hasForeground get() = foreground != null override fun onActivityResumed(activity: Activity) { + if (activity is SuRequestActivity) return foreground = activity } override fun onActivityPaused(activity: Activity) { + if (activity is SuRequestActivity) return foreground = null }