SettingsActivity: account for module present but no root
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
d200437813
commit
12be972fcd
@ -83,6 +83,15 @@ class SettingsActivity : ThemeChangeAwareActivity() {
|
|||||||
moduleInstaller?.isVisible = false
|
moduleInstaller?.isVisible = false
|
||||||
if (ModuleLoader.isModuleLoaded()) {
|
if (ModuleLoader.isModuleLoaded()) {
|
||||||
moduleInstaller?.parent?.removePreference(moduleInstaller)
|
moduleInstaller?.parent?.removePreference(moduleInstaller)
|
||||||
|
lifecycleScope.launch {
|
||||||
|
if (Application.getBackend() !is WgQuickBackend) {
|
||||||
|
try {
|
||||||
|
withContext(Dispatchers.IO) { Application.getRootShell().start() }
|
||||||
|
} catch (_: Throwable) {
|
||||||
|
kernelModuleDisabler?.parent?.removePreference(kernelModuleDisabler)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
kernelModuleDisabler?.parent?.removePreference(kernelModuleDisabler)
|
kernelModuleDisabler?.parent?.removePreference(kernelModuleDisabler)
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
|
Loading…
Reference in New Issue
Block a user