mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 23:36:47 +00:00
Fix DT2S (Root) using keyevent (#3799)
* Add alternative root execution for dt2s * Fix styling * Use Shell instead
This commit is contained in:
@@ -37,12 +37,12 @@ import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import app.lawnchair.LawnchairLauncher
|
||||
import app.lawnchair.lawnchairApp
|
||||
import app.lawnchair.root.RootHelperManager
|
||||
import app.lawnchair.ui.AlertBottomSheetContent
|
||||
import app.lawnchair.util.requireSystemService
|
||||
import app.lawnchair.views.ComposeBottomSheet
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.Utilities
|
||||
import com.topjohnwu.superuser.Shell
|
||||
|
||||
class SleepGestureHandler(context: Context) : GestureHandler(context) {
|
||||
|
||||
@@ -63,12 +63,11 @@ class SleepGestureHandler(context: Context) : GestureHandler(context) {
|
||||
}
|
||||
|
||||
class SleepMethodRoot(context: Context) : SleepGestureHandler.SleepMethod(context) {
|
||||
private val rootHelperManager = RootHelperManager.INSTANCE.get(context)
|
||||
|
||||
override suspend fun isSupported() = rootHelperManager.isAvailable()
|
||||
override suspend fun isSupported() = Shell.getShell().isRoot
|
||||
|
||||
override suspend fun sleep(launcher: LawnchairLauncher) {
|
||||
rootHelperManager.getService().goToSleep()
|
||||
Shell.su("input keyevent 26").exec()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user