Manager: fix ModulesFragment reboot menu

- correct 'booloader' typo breaking bootloader entry
- remove extra bootloader entry Shell.su line which is unnecessary since it's covered by reboot()
- revert to using `reboot recovery` for recovery entry since `svc power reboot recovery` triggers a very disconcerting "Factory data reset" reboot dialog on many devices
- add Reboot to EDL mode option for good measure
This commit is contained in:
osm0sis 2019-06-24 16:13:31 -03:00 committed by John Wu
parent b0e49a4cc8
commit b1e63f0f14
3 changed files with 12 additions and 3 deletions

View File

@ -68,18 +68,21 @@ class ModulesFragment : MagiskFragment<ModuleViewModel, FragmentModulesBinding>(
return true return true
} }
R.id.reboot_recovery -> { R.id.reboot_recovery -> {
reboot("recovery") Shell.su("/system/bin/reboot recovery").submit()
return true return true
} }
R.id.reboot_bootloader -> { R.id.reboot_bootloader -> {
reboot("booloader") reboot("bootloader")
Shell.su("/system/bin/reboot bootloader").submit()
return true return true
} }
R.id.reboot_download -> { R.id.reboot_download -> {
reboot("download") reboot("download")
return true return true
} }
R.id.reboot_edl -> {
reboot("edl")
return true
}
else -> return false else -> return false
} }
} }

View File

@ -22,4 +22,9 @@
android:title="@string/reboot_download" android:title="@string/reboot_download"
app:showAsAction="never" /> app:showAsAction="never" />
<item
android:id="@+id/reboot_edl"
android:title="@string/reboot_edl"
app:showAsAction="never" />
</menu> </menu>

View File

@ -44,6 +44,7 @@
<string name="reboot_recovery">Reboot to Recovery</string> <string name="reboot_recovery">Reboot to Recovery</string>
<string name="reboot_bootloader">Reboot to Bootloader</string> <string name="reboot_bootloader">Reboot to Bootloader</string>
<string name="reboot_download">Reboot to Download</string> <string name="reboot_download">Reboot to Download</string>
<string name="reboot_edl">Reboot to EDL</string>
<!--Repo Fragment--> <!--Repo Fragment-->
<string name="update_available">Update Available</string> <string name="update_available">Update Available</string>