mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-05-01 15:04:25 +02:00
Expose safe mode option on 28+
This commit is contained in:
parent
4fb6a7268c
commit
46980819c0
@ -41,7 +41,7 @@ object RebootMenu {
|
|||||||
activity.getSystemService<PowerManager>()?.isRebootingUserspaceSupported == true) {
|
activity.getSystemService<PowerManager>()?.isRebootingUserspaceSupported == true) {
|
||||||
menu.menu.findItem(R.id.action_reboot_userspace).isVisible = true
|
menu.menu.findItem(R.id.action_reboot_userspace).isVisible = true
|
||||||
}
|
}
|
||||||
if (Const.Version.isCanary()) {
|
if (Const.Version.atLeast_28_0()) {
|
||||||
menu.menu.findItem(R.id.action_reboot_safe_mode).isChecked = Config.bootloop >= 2
|
menu.menu.findItem(R.id.action_reboot_safe_mode).isChecked = Config.bootloop >= 2
|
||||||
} else {
|
} else {
|
||||||
menu.menu.findItem(R.id.action_reboot_safe_mode).isVisible = false
|
menu.menu.findItem(R.id.action_reboot_safe_mode).isVisible = false
|
||||||
|
@ -28,6 +28,7 @@ object Const {
|
|||||||
|
|
||||||
fun atLeast_24_0() = Info.env.versionCode >= 24000 || isCanary()
|
fun atLeast_24_0() = Info.env.versionCode >= 24000 || isCanary()
|
||||||
fun atLeast_25_0() = Info.env.versionCode >= 25000 || isCanary()
|
fun atLeast_25_0() = Info.env.versionCode >= 25000 || isCanary()
|
||||||
|
fun atLeast_28_0() = Info.env.versionCode >= 28000 || isCanary()
|
||||||
fun isCanary() = isCanary(Info.env.versionCode)
|
fun isCanary() = isCanary(Info.env.versionCode)
|
||||||
|
|
||||||
fun isCanary(ver: Int) = ver > 0 && ver % 100 != 0
|
fun isCanary(ver: Int) = ver > 0 && ver % 100 != 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user