celzero / rethink-app

DNS over HTTPS / DNS over Tor / DNSCrypt client, WireGuard proxifier, firewall, and connection tracker for Android.
https://rethinkfirewall.com/
Apache License 2.0
3.01k stars 154 forks source link

IllegalStateException in ConnTrackerBottomSheet #1132

Closed ignoramous closed 9 months ago

ignoramous commented 1 year ago

When accessing an entry from "Unknown" app for ICMP reqs

11-05 09:23:49.239 23449 23449 E AndroidRuntime: Process: com.celzero.bravedns, PID: 23449
11-05 09:23:49.239 23449 23449 E AndroidRuntime: java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time.
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at androidx.room.RoomDatabase.assertNotMainThread(RoomDatabase.kt:444)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at androidx.room.SharedSQLiteStatement.assertNotMainThread(SharedSQLiteStatement.kt:52)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at androidx.room.SharedSQLiteStatement.acquire(SharedSQLiteStatement.kt:74)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at com.celzero.bravedns.database.AppInfoDAO_Impl.updateFirewallStatusByUid(AppInfoDAO_Impl.java:220)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at com.celzero.bravedns.database.AppInfoRepository.updateFirewallStatusByUid(AppInfoRepository.kt:45)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at com.celzero.bravedns.service.FirewallManager.updateFirewallStatus(FirewallManager.kt:514)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at com.celzero.bravedns.ui.bottomsheet.ConnTrackerBottomSheet$applyFirewallRule$1$1.invokeSuspend(ConnTrackerBottomSheet.kt:619)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at com.celzero.bravedns.ui.bottomsheet.ConnTrackerBottomSheet$applyFirewallRule$1$1.invoke(Unknown Source:8)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at com.celzero.bravedns.ui.bottomsheet.ConnTrackerBottomSheet$applyFirewallRule$1$1.invoke(Unknown Source:2)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at com.celzero.bravedns.ui.bottomsheet.ConnTrackerBottomSheet$uiCtx$2.invokeSuspend(ConnTrackerBottomSheet.kt:737)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:942)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:99)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at android.os.Looper.loopOnce(Looper.java:240)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:351)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:8381)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
11-05 09:23:49.239 23449 23449 E AndroidRuntime:    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@66789b1, Dispatchers.Main.immediate]
11-05 09:23:49.248  1882  
hussainmohd-a commented 9 months ago

Fixed as part of Firewall changes https://github.com/celzero/rethink-app/pull/1154/commits/531c16a43feb4b5d67cde5858e34ec8afbdd8d02