summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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());