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

Commit c9d8d2b7 authored by Nikita Ioffe's avatar Nikita Ioffe Committed by Gerrit Code Review
Browse files

Merge "Don't proceed with userspace reboot if device doesn't support it"

parents a275bc4b 9f473c05
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -834,6 +834,10 @@ static void UserspaceRebootWatchdogThread() {
}

static void HandleUserspaceReboot() {
    if (!android::sysprop::InitProperties::userspace_reboot_in_progress().value_or(false)) {
        LOG(ERROR) << "Attempted a userspace reboot on a device that doesn't support it";
        return;
    }
    // Spinnig up a separate thread will fail the setns call later in the boot sequence.
    // Fork a new process to monitor userspace reboot while we are investigating a better solution.
    pid_t pid = fork();
+9 −0
Original line number Diff line number Diff line
@@ -25,3 +25,12 @@ prop {
    integer_as_bool: true
}

# Shows whenever the device supports userspace reboot or not.
prop {
    api_name: "is_userspace_reboot_supported"
    type: Boolean
    scope: System
    access: Readonly
    prop_name: "ro.init.userspace_reboot.is_supported"
    integer_as_bool: true
}
+5 −0
Original line number Diff line number Diff line
props {
  module: "android.sysprop.InitProperties"
  prop {
    api_name: "is_userspace_reboot_supported"
    prop_name: "ro.init.userspace_reboot.is_supported"
    integer_as_bool: true
  }
  prop {
    api_name: "userspace_reboot_in_progress"
    access: ReadWrite