| 45 | static void command_shutdown() { OHDUtil::run_command("shutdown", {}, true); } |
| 46 | |
| 47 | void openhd::reboot::systemctl_power(bool shutdownOnly) { |
| 48 | if (shutdownOnly) { |
| 49 | // Some Images don't allow soft restarts or reboots when a netork is |
| 50 | // connected |
| 51 | if ((OHDPlatform::instance().platform_type == |
| 52 | X_PLATFORM_TYPE_ROCKCHIP_RK3566_RADXA_ZERO3W) || |
| 53 | (OHDPlatform::instance().platform_type == |
| 54 | X_PLATFORM_TYPE_ROCKCHIP_RK3566_RADXA_CM3)) { |
| 55 | command_shutdown(); |
| 56 | } else { |
| 57 | systemctl_shutdown(); |
| 58 | } |
| 59 | } else { |
| 60 | if ((OHDPlatform::instance().platform_type == |
| 61 | X_PLATFORM_TYPE_ROCKCHIP_RK3566_RADXA_ZERO3W) || |
| 62 | (OHDPlatform::instance().platform_type == |
| 63 | X_PLATFORM_TYPE_ROCKCHIP_RK3566_RADXA_CM3)) { |
| 64 | command_reboot(); |
| 65 | } else { |
| 66 | systemctl_reboot(); |
| 67 | } |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | void openhd::reboot::handle_power_command_async(std::chrono::milliseconds delay, |
| 72 | bool shutdownOnly) { |
nothing calls this directly
no test coverage detected