summaryrefslogtreecommitdiffhomepage
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/com/wireguard/android/preference/ToolsInstallerPreference.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/src/main/java/com/wireguard/android/preference/ToolsInstallerPreference.java b/app/src/main/java/com/wireguard/android/preference/ToolsInstallerPreference.java
index 15a8ab6a..1620fd10 100644
--- a/app/src/main/java/com/wireguard/android/preference/ToolsInstallerPreference.java
+++ b/app/src/main/java/com/wireguard/android/preference/ToolsInstallerPreference.java
@@ -59,6 +59,13 @@ public class ToolsInstallerPreference extends Preference {
}
@Override
+ protected void onAttachedToActivity() {
+ super.onAttachedToActivity();
+ asyncWorker.supplyAsync(toolsInstaller::areInstalled)
+ .thenAccept(installed -> setState(installed ? State.ALREADY : State.INITIAL));
+ }
+
+ @Override
protected void onClick() {
setState(State.WORKING);
asyncWorker.supplyAsync(toolsInstaller::install)