From 764c1ac8ba71122695dac9cecb80a79cf99aace2 Mon Sep 17 00:00:00 2001 From: Nikita Ioffe Date: Mon, 27 Jan 2020 17:14:46 +0000 Subject: [PATCH] Trigger boot animation on userspace reboot Also reset some more properties to make bootanimation work properly. Test: adb reboot userspace Bug: 148172262 Change-Id: I0154d4fe9377c019150f5b1a709c406925db584d --- init/reboot.cpp | 7 +++++-- rootdir/init.rc | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/init/reboot.cpp b/init/reboot.cpp index 4ee718847..8c9071494 100644 --- a/init/reboot.cpp +++ b/init/reboot.cpp @@ -741,12 +741,15 @@ static Result DoUserspaceReboot() { }); // Triggering userspace-reboot-requested will result in a bunch of setprop // actions. We should make sure, that all of them are propagated before - // proceeding with userspace reboot. Synchronously setting kUserspaceRebootInProgress property - // is not perfect, but it should do the trick. + // proceeding with userspace reboot. Synchronously setting sys.init.userspace_reboot.in_progress + // property is not perfect, but it should do the trick. if (!android::sysprop::InitProperties::userspace_reboot_in_progress(true)) { return Error() << "Failed to set sys.init.userspace_reboot.in_progress property"; } EnterShutdown(); + if (!SetProperty("sys.powerctl", "")) { + return Error() << "Failed to reset sys.powerctl property"; + } std::vector stop_first; // Remember the services that were enabled. We will need to manually enable them again otherwise // triggers like class_start won't restart them. diff --git a/rootdir/init.rc b/rootdir/init.rc index e57580814..c4f3e1587 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -1012,6 +1012,7 @@ on userspace-reboot-requested setprop apexd.status "" setprop sys.user.0.ce_available "" setprop sys.shutdown.requested "" + setprop service.bootanim.exit "" on userspace-reboot-fs-remount # Make sure that vold is running. @@ -1021,6 +1022,7 @@ on userspace-reboot-fs-remount exec - system system -- /system/bin/vdc checkpoint resetCheckpoint exec - system system -- /system/bin/vdc checkpoint markBootAttempt remount_userdata + start bootanim on userspace-reboot-resume trigger userspace-reboot-fs-remount