-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
DNSFilterService.java – onDestroy() → shutdown()
onDestroy() is invoked on the main thread. Inside this method, shutdown() is called synchronously, and shutdown() itself contains several operations that may be heavy or slow, such as:
- runningVPN.stop(true)
- DNSFILTERPROXY.stop()
- dnsReqForwarder.clearForward()
- clearPortRedir()
These operations likely involve VPN teardown, proxy shutdown, port cleanup, and other tasks that may take noticeable time. Executing them on the main thread could block the UI. So it is recommended to move it off the UI thread.
BootUpReceiver.java – onReceive() → getConfig()
onReceive() always runs on the main thread. getConfig() performs disk I/O when loading configuration files, which can block the main thread. According to Android’s official guidelines, file I/O should not be done on the UI thread.
DNSProxyActivity.java – onActivityResult() → onBackupRestore()
onBackupRestore() performs:
- File I/O
- ZIP compression/decompression
These are typical long-running operations. Since onActivityResult() runs on the main thread, executing them synchronously may cause noticeable UI freezes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels