Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27b0c5f3 authored by Diogo Ferreira's avatar Diogo Ferreira
Browse files

Add recovery and bootloader popup options to reboot dialog.

parent 0c176eb3
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -100,7 +100,17 @@ public final class ShutdownThread extends Thread {
                dialog = new AlertDialog.Builder(context)
                        .setIcon(android.R.drawable.ic_dialog_alert)
                        .setTitle(com.android.internal.R.string.reboot_system)
                        .setMessage(com.android.internal.R.string.reboot_confirm)
                        .setSingleChoiceItems(com.android.internal.R.array.shutdown_reboot_options, 0, new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int which) {
                                if (which < 0)
                                    return;

                                String actions[] = context.getResources().getStringArray(com.android.internal.R.array.shutdown_reboot_actions);

                                if (actions != null && which < actions.length)
                                    mRebootReason = actions[which];
                            }
                        })
                        .setPositiveButton(com.android.internal.R.string.yes, new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int which) {
                               mReboot = true;
+16 −0
Original line number Diff line number Diff line
@@ -142,4 +142,20 @@
        <item><xliff:g id="id">ime</xliff:g></item>
    </string-array>

    <!-- Defines the shutdown options shown in the reboot dialog. -->
    <array name="shutdown_reboot_options">
        <item>Reboot</item>
        <item>Recovery</item>
        <item>Bootloader</item>
    </array>

    <!-- Do not translate. Defines the shutdown actions passed to the kernel.
         The first item should be empty for regular reboot. -->
    <string-array name="shutdown_reboot_actions">
        <item></item>
        <item>recovery</item>
        <item>bootloader</item>
    </string-array>


</resources>