diff options
author | Paul Lawrence <paullawrence@google.com> | 2024-03-04 15:51:27 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2024-03-04 15:51:27 +0000 |
commit | 15e70c81983a0595dfba9ae650d1b06736c486fb (patch) | |
tree | ca2c4713e2ccd5e4efda82db8c9993ae3fbadf57 /cmds | |
parent | a98bb79a65615ef7d43bea4d67b1b33800c14bd9 (diff) | |
parent | ae6753571e418e012a84ee5f4a955a09fd1de8dc (diff) | |
download | base-15e70c81983a0595dfba9ae650d1b06736c486fb.tar.gz |
Merge "Prevent error message on svc power reboot" into main am: ae6753571e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2983091
Change-Id: I4a4cee32e1b3bd96addcd3b2fc82708f24484f44
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/svc/src/com/android/commands/svc/PowerCommand.java | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/cmds/svc/src/com/android/commands/svc/PowerCommand.java b/cmds/svc/src/com/android/commands/svc/PowerCommand.java index a7560b23c6bd..12b79f4c42f8 100644 --- a/cmds/svc/src/com/android/commands/svc/PowerCommand.java +++ b/cmds/svc/src/com/android/commands/svc/PowerCommand.java @@ -23,8 +23,6 @@ import android.os.PowerManager; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemClock; -import android.os.SystemProperties; -import android.sysprop.InitProperties; public class PowerCommand extends Svc.Command { private static final int FORCE_SUSPEND_DELAY_DEFAULT_MILLIS = 0; @@ -142,12 +140,10 @@ public class PowerCommand extends Svc.Command { // Check if remote exception is benign during shutdown. Pm can be killed // before system server during shutdown, so remote exception can be ignored // if it is already in shutdown flow. + // sys.powerctl is no longer set to avoid a possible DOS attack (see + // bionic/libc/bionic/system_property_set.cpp) so we have no real way of knowing if a + // remote exception is real or simply because pm is killed (b/318323013) + // So we simply do not display anything. private void maybeLogRemoteException(String msg) { - String powerProp = SystemProperties.get("sys.powerctl"); - // Also check if userspace reboot is ongoing, since in case of userspace reboot value of the - // sys.powerctl property will be reset. - if (powerProp.isEmpty() && !InitProperties.userspace_reboot_in_progress().orElse(false)) { - System.err.println(msg); - } } } |