wireguard-android/ui
Harsh Shandilya 2f088938c6 ui: replace GlobalScope with a hand-rolled CoroutineScope
GlobalScope has numerous problems[1] that make it unfit for
use in most applications and making it behave correctly requires
an excessive amount of verbosity that's alleviated simply by using
any other scope. Since we run multiple operations in the context
of the application's lifecycle, introduce a new scope that is created
when our application is, and cancelled upon its termination.

While at it, make the scope default to Dispatchers.IO to reduce pressure
on the UI event loop. Tasks requiring access to the UI thread appropriately
switch context making the change completely safe.

1: https://medium.com/@elizarov/the-reason-to-avoid-globalscope-835337445abc

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-09-16 18:01:06 +02:00
..
sampledata Rename app module to ui 2020-03-09 19:24:27 +05:30
src ui: replace GlobalScope with a hand-rolled CoroutineScope 2020-09-16 18:01:06 +02:00
build.gradle coroutines: use lifecycleScope where appropriate 2020-09-15 23:46:11 +02:00
proguard-android-optimize.txt build: Improve R8 rules and enable aggressive optimization modes 2020-03-29 10:52:54 +05:30
proguard-rules.pro build: don't obfuscate code in minify step 2020-04-21 21:36:59 +05:30