manager: Create new root shell for time consuming task
This commit is contained in:
@@ -63,7 +63,7 @@ fun execKsud(args: String, newShell: Boolean = false): Boolean {
|
|||||||
|
|
||||||
fun install() {
|
fun install() {
|
||||||
val start = SystemClock.elapsedRealtime()
|
val start = SystemClock.elapsedRealtime()
|
||||||
val result = execKsud("install")
|
val result = execKsud("install", true)
|
||||||
Log.w(TAG, "install result: $result, cost: ${SystemClock.elapsedRealtime() - start}ms")
|
Log.w(TAG, "install result: $result, cost: ${SystemClock.elapsedRealtime() - start}ms")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,14 +93,14 @@ fun toggleModule(id: String, enable: Boolean): Boolean {
|
|||||||
} else {
|
} else {
|
||||||
"module disable $id"
|
"module disable $id"
|
||||||
}
|
}
|
||||||
val result = execKsud(cmd)
|
val result = execKsud(cmd, true)
|
||||||
Log.i(TAG, "$cmd result: $result")
|
Log.i(TAG, "$cmd result: $result")
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
fun uninstallModule(id: String): Boolean {
|
fun uninstallModule(id: String): Boolean {
|
||||||
val cmd = "module uninstall $id"
|
val cmd = "module uninstall $id"
|
||||||
val result = execKsud(cmd)
|
val result = execKsud(cmd, true)
|
||||||
Log.i(TAG, "uninstall module $id result: $result")
|
Log.i(TAG, "uninstall module $id result: $result")
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user