summaryrefslogtreecommitdiffhomepage
path: root/ui
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-03-10 09:03:06 -0600
committerHarsh Shandilya <me@msfjarvis.dev>2020-03-10 22:12:16 +0530
commit7e029f1db0b2f7b5dd7e0469c79ddb386ac40337 (patch)
tree1b1df22f1b520628791af483849e2ce6ce06e0f8 /ui
parentd4875afe31430566587bbdf1cc4ea5705173c081 (diff)
ModuleDownloaderPreference: remove disable_kernel_module after downloading
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/src/main/java/com/wireguard/android/preference/KernelModuleDisablerPreference.java10
-rw-r--r--ui/src/main/java/com/wireguard/android/preference/ModuleDownloaderPreference.java1
2 files changed, 6 insertions, 5 deletions
diff --git a/ui/src/main/java/com/wireguard/android/preference/KernelModuleDisablerPreference.java b/ui/src/main/java/com/wireguard/android/preference/KernelModuleDisablerPreference.java
index f991fb22..0ea22b24 100644
--- a/ui/src/main/java/com/wireguard/android/preference/KernelModuleDisablerPreference.java
+++ b/ui/src/main/java/com/wireguard/android/preference/KernelModuleDisablerPreference.java
@@ -60,12 +60,12 @@ public class KernelModuleDisablerPreference extends Preference {
Thread.sleep(Math.max(0, 1000 * 5 - (SystemClock.elapsedRealtime() - start)));
} catch (final Exception ignored) {
}
- final Intent i = getContext().getPackageManager().getLaunchIntentForPackage(getContext().getPackageName());
- if (i == null)
+ final Intent restartIntent = getContext().getPackageManager().getLaunchIntentForPackage(getContext().getPackageName());
+ if (restartIntent == null)
return;
- i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- Application.get().startActivity(i);
+ restartIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ restartIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ Application.get().startActivity(restartIntent);
System.exit(0);
});
}).join());
diff --git a/ui/src/main/java/com/wireguard/android/preference/ModuleDownloaderPreference.java b/ui/src/main/java/com/wireguard/android/preference/ModuleDownloaderPreference.java
index 750cb05e..a7c24cee 100644
--- a/ui/src/main/java/com/wireguard/android/preference/ModuleDownloaderPreference.java
+++ b/ui/src/main/java/com/wireguard/android/preference/ModuleDownloaderPreference.java
@@ -51,6 +51,7 @@ public class ModuleDownloaderPreference extends Preference {
setState(State.NOTFOUND);
else if (result == OsConstants.EXIT_SUCCESS) {
setState(State.SUCCESS);
+ Application.getSharedPreferences().edit().remove("disable_kernel_module").apply();
Application.getAsyncWorker().runAsync(() -> {
Thread.sleep(1000 * 5);
final Intent restartIntent = getContext().getPackageManager().getLaunchIntentForPackage(getContext().getPackageName());