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

Commit 37bba3b8 authored by Todd Poynor's avatar Todd Poynor Committed by Keun-young Park
Browse files

libcutils: android_reboot: add thermal shutdown command

Add ANDROID_RB_THERMOFF command to android_reboot(), denoting a power
off due to thermal limits exceeded.  When this command is used, Android
may provide notification to the user about the potentially unexpected
power off at next boot.

Bug: 30994946
Test: Manual: setprop sys.powerctl thermal-shutdown
Change-Id: If2cde1b6a3c281a5750b50295412a4801ed5b2f2
parent 41c7bb50
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -209,6 +209,10 @@ int android_reboot_with_callback(
                           LINUX_REBOOT_CMD_RESTART2, arg);
            break;

        case ANDROID_RB_THERMOFF:
            ret = reboot(RB_POWER_OFF);
            break;

        default:
            ret = -1;
    }
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ __BEGIN_DECLS
#define ANDROID_RB_RESTART  0xDEAD0001
#define ANDROID_RB_POWEROFF 0xDEAD0002
#define ANDROID_RB_RESTART2 0xDEAD0003
#define ANDROID_RB_THERMOFF 0xDEAD0004

/* Properties */
#define ANDROID_RB_PROPERTY "sys.powerctl"