Skip to content

Commit

Permalink
Fix RequestPermissionActivity takes forever to show up
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkaW committed Feb 3, 2023
1 parent 59c5ffe commit 583931b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -55,7 +56,7 @@ class ShizukuManagerProvider : ShizukuProvider() {
}
}

Shizuku.addBinderReceivedListenerSticky(listener)
Shizuku.addBinderReceivedListenerSticky(listener, workerHandler)

return try {
countDownLatch.await(5, TimeUnit.SECONDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -72,7 +73,7 @@ class RequestPermissionActivity : AppActivity() {
}
}

Shizuku.addBinderReceivedListenerSticky(listener)
Shizuku.addBinderReceivedListenerSticky(listener, workerHandler)

return try {
countDownLatch.await(5, TimeUnit.SECONDS)
Expand All @@ -82,6 +83,7 @@ class RequestPermissionActivity : AppActivity() {
false
}
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

Expand Down

0 comments on commit 583931b

Please sign in to comment.