From 583931bce8d35c39dfa86861e3f5270c053ae3f0 Mon Sep 17 00:00:00 2001 From: RikkaW Date: Fri, 3 Feb 2023 21:11:13 +0800 Subject: [PATCH] Fix RequestPermissionActivity takes forever to show up --- .../main/java/moe/shizuku/manager/ShizukuManagerProvider.kt | 3 ++- .../manager/authorization/RequestPermissionActivity.kt | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/manager/src/main/java/moe/shizuku/manager/ShizukuManagerProvider.kt b/manager/src/main/java/moe/shizuku/manager/ShizukuManagerProvider.kt index cca466656..8bc4f446d 100644 --- a/manager/src/main/java/moe/shizuku/manager/ShizukuManagerProvider.kt +++ b/manager/src/main/java/moe/shizuku/manager/ShizukuManagerProvider.kt @@ -7,6 +7,7 @@ import moe.shizuku.manager.utils.Logger.LOGGER import rikka.shizuku.Shizuku import rikka.shizuku.ShizukuApiConstants.USER_SERVICE_ARG_TOKEN import rikka.shizuku.ShizukuProvider +import rikka.shizuku.server.ktx.workerHandler import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit import java.util.concurrent.TimeoutException @@ -55,7 +56,7 @@ class ShizukuManagerProvider : ShizukuProvider() { } } - Shizuku.addBinderReceivedListenerSticky(listener) + Shizuku.addBinderReceivedListenerSticky(listener, workerHandler) return try { countDownLatch.await(5, TimeUnit.SECONDS) diff --git a/manager/src/main/java/moe/shizuku/manager/authorization/RequestPermissionActivity.kt b/manager/src/main/java/moe/shizuku/manager/authorization/RequestPermissionActivity.kt index b55a3fa1e..2523ade6e 100644 --- a/manager/src/main/java/moe/shizuku/manager/authorization/RequestPermissionActivity.kt +++ b/manager/src/main/java/moe/shizuku/manager/authorization/RequestPermissionActivity.kt @@ -19,6 +19,7 @@ import rikka.html.text.HtmlCompat import rikka.shizuku.Shizuku import rikka.shizuku.ShizukuApiConstants.REQUEST_PERMISSION_REPLY_ALLOWED import rikka.shizuku.ShizukuApiConstants.REQUEST_PERMISSION_REPLY_IS_ONETIME +import rikka.shizuku.server.ktx.workerHandler import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit import java.util.concurrent.TimeoutException @@ -72,7 +73,7 @@ class RequestPermissionActivity : AppActivity() { } } - Shizuku.addBinderReceivedListenerSticky(listener) + Shizuku.addBinderReceivedListenerSticky(listener, workerHandler) return try { countDownLatch.await(5, TimeUnit.SECONDS) @@ -82,6 +83,7 @@ class RequestPermissionActivity : AppActivity() { false } } + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState)