ModuleDownloaderPreference: remove disable_kernel_module after downloading
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
d4875afe31
commit
7e029f1db0
@ -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());
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user