aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/src/main/java/com/wireguard/android/model (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ui: replace GlobalScope with a hand-rolled CoroutineScopeHarsh Shandilya2020-09-162-8/+8
| | | | | | | | | | | | | | | | | 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>
* global: lint codebase with recent changesJason A. Donenfeld2020-09-161-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: don't use low-level logger APIHarsh Shandilya2020-09-162-5/+5
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* coroutines: convert the restJason A. Donenfeld2020-09-152-119/+171
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ObservableTunnel: account for race in renulling statsJason A. Donenfeld2020-04-151-2/+2
| | | | | | | | | | | | | | The stats might become null between these two checks, when a tunnel flips off, resulting in a null pointer dereference: at com.wireguard.android.model.ObservableTunnel.getStatisticsAsync (ObservableTunnel.java:103) at com.wireguard.android.fragment.TunnelDetailFragment.updateStats (TunnelDetailFragment.java:108) at com.wireguard.android.fragment.TunnelDetailFragment.access$updateStats (TunnelDetailFragment.java:27) at com.wireguard.android.fragment.TunnelDetailFragment$onResume$1.run (TunnelDetailFragment.java:74) at java.util.TimerThread.mainLoop (TimerThread.java:562) at java.util.TimerThread.run (TimerThread.java:512) Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* AppListDialogFragment: support both inclusion and exclusionJason A. Donenfeld2020-04-061-3/+3
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ObservableTunnel: do not cache keyJason A. Donenfeld2020-04-011-1/+2
| | | | | Reported-by: Reza Island's <rezza.aji.ras@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: cleanup code styleJason A. Donenfeld2020-03-303-2/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ObservableTunnel: Don't cache configAsyncHarsh Shandilya2020-03-301-4/+5
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* ObservableTunnel: do not cache statsJason A. Donenfeld2020-03-281-4/+5
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelComparator: naturally sort tunnel listJason A. Donenfeld2020-03-282-3/+61
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ObservableTunnel: Don't recurse in getConfigHarsh Shandilya2020-03-281-2/+2
| | | | | | | The correct way to retrieve the value inside a getter/setter is to use `field` to ensure you don't invoke the getter while inside the getter and trigger a stack overflow Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* databinding: rewrite in kotlinJason A. Donenfeld2020-03-273-11/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelManager: convert to kotlinJason A. Donenfeld2020-03-263-308/+242
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ObservableTunnel: port to kotlinJason A. Donenfeld2020-03-262-143/+114
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: cleanup various pieces of kotlinJason A. Donenfeld2020-03-261-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelManager: disallow remote apps for LJason A. Donenfeld2020-03-241-1/+3
| | | | | | I don't trust old Android versions to have gotten this right. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelManager: save settings before restartJason A. Donenfeld2020-03-231-3/+6
| | | | | | Otherwise these get lost and then the restored state is confusing. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* TunnelManager: enable Tasker supportJason A. Donenfeld2020-03-221-4/+1
| | | | | | | Also fix up wording for the permission prompt that Tasker will show when initially setting this up. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* model: begin conversionJason A. Donenfeld2020-03-222-57/+24
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: java access control has important semantic meaningJason A. Donenfeld2020-03-101-1/+1
| | | | | | | It's not right to blindly follow all of AndroidStudio's suggestions, especially for things in tunnel/ which comprise useful API. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ui: Codestyle cleanupsHarsh Shandilya2020-03-101-1/+1
| | | | Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* KernelModuleDisablerPreference: turn off tunnels before switching backendJason A. Donenfeld2020-03-091-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: format codeJason A. Donenfeld2020-03-091-7/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: optimize importsJason A. Donenfeld2020-03-093-17/+14
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: get rid of nonnull gradle hackJason A. Donenfeld2020-03-093-0/+9
| | | | | | | | | | Hacking things up via gradle is not right, and package-info.java poses problems with two modules, so instead we just apply it manually to every class. Remember to add this to new classes! Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ObservableTunnel: pass right argument to state transitionJason A. Donenfeld2020-03-091-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Rename app module to uiHarsh Shandilya2020-03-093-0/+497
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>