From e8350470776a7a81f0751656641179afb9cc8814 Mon Sep 17 00:00:00 2001 From: Chenfu Liao Date: Wed, 30 Jun 2021 15:52:00 +0800 Subject: [PATCH] Fix Quiescent Reboot Reason [Description] Revise system property "sys.powerctl" when the reason is quiescent. When the reason is only quiescent, the value of the system property "sys.powerctl" should be "reboot,quiescent" instead of "reboot,,quiescent". Bug: 192634025 Test: adb shell svc power reboot quiescent Change-Id: I9b3ac851f85fac093c4767f5bc82baa07181dda5 --- .../java/com/android/server/power/PowerManagerService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index 061fabf3ab2a7..e927667c2eaa0 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -3756,7 +3756,10 @@ public final class PowerManagerService extends SystemService if (sQuiescent) { // Pass the optional "quiescent" argument to the bootloader to let it know // that it should not turn the screen/lights on. - reason = reason + ",quiescent"; + if (reason != ""){ + reason += ","; + } + reason = reason + "quiescent"; } SystemProperties.set("sys.powerctl", "reboot," + reason);