javaandroidpowermanagerandroid-powermanager

Should we call PowerManger's reboot method in a separate thread?


I need to programmatically reboot an android device, and the PowerManager's reboot functionality comes in handy.

My question is:
Should reboot be called in a separate thread or is it okay to call it in the same thread?


Solution

  • While I am not an Android developer, here's what I found.

    tl;dr : I haven't seen examples of calling reboot in it's own thread; have you?

    Here's the official reboot docs enter image description here

    Here's a SO answer on using reboot, no mention of calling it in a separate thread

    Here's a 'crowd-sourced cookbook' article about using reboot; nomention of calling it in a separate thread

    Guessing the API handles it gracefully automatically for you.