Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reboot android phone from kernel code

Tags:

android

Is it possible to reboot by calling SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper)?

like image 652
Munipratap Avatar asked Nov 05 '22 04:11

Munipratap


2 Answers

Actually you can only if your mobile device is rooted. As alternative you can run adb reboot within your code. adb has the super user permission.

like image 94
Blackbelt Avatar answered Nov 09 '22 10:11

Blackbelt


//include this file in kernel code

#include<cutils/android_reboot.h>

//call this function

android_reboot(ANDROID_RB_RESTART,0,0);
like image 27
Munipratap Avatar answered Nov 09 '22 10:11

Munipratap