-1

I am using a Android device having custom ROM and need to reboot that device. I am able to reboot the device from hardware side, but I want to programmatically check if the device can be rebooted.

Is there any way to do that?

sourav.bh
  • 467
  • 1
  • 7
  • 20
Rojy George
  • 117
  • 6
  • Why you think that the device can be non-rebootable? – Vladyslav Matviienko Jan 17 '19 at 08:28
  • @VladyslavMatviienko Tried with stock Android and was not able to reboot.Do all the devices using Custom ROMs are rebootable? – Rojy George Jan 17 '19 at 08:42
  • if you were unable to reboot still does not mean that the device is not rebootable. from the hardware side (the device side) the reboot means power off + power on, or resetting temporal memory (RAM, CPU registers) to empty state + resetting all hardware to default state (camera, wifi, bluetooth, etc.). I'm sure that every android-capable device is ale to do that. As for the software side - by default (without having root permissions) you can't reboot the device programmatically. Also nobody knows how you have tried to reboot it. – Vladyslav Matviienko Jan 17 '19 at 08:46
  • I tried to reboot programatically. if we have root permission we can reboot android device , is that correct? – Rojy George Jan 17 '19 at 09:00
  • yes, but `Also nobody knows how you have tried to reboot it.` – Vladyslav Matviienko Jan 17 '19 at 09:49
  • Used the following code Process process = Runtime.getRuntime().exec(new String[]{"su", "-c", "reboot"}); process.waitFor(); But this is not rebooting in some rooted device – Rojy George Jan 17 '19 at 09:54
  • check the command output to know why – Vladyslav Matviienko Jan 17 '19 at 11:10
  • Please post the source code which you already tried with, that will help others to find any lacking of your implementation. – sourav.bh Jan 17 '19 at 11:11

1 Answers1

0

Check the device is rooted or not.
If the device is rooted, then request root permission and you can reboot the device.

Here is how to check root access is available or not.