Question

Since API level 8 PowerManager has contained a reboot() method.

I've added the required permission to my manifest, acquired the PowerManager object and call

pm.reboot();

This results in a force close with this stack trace

01-04 16:58:35.847: ERROR/AndroidRuntime(2945): java.lang.SecurityException: Neither user 10060 nor current process has android.permission.REBOOT.

Does anyone know if this PowerManager.reboot() method is supposed to be available to applications? Since it is in the documentation I kind of guessed that it was ok to use.

Was it helpful?

Solution

Does anyone know if this PowerManager.reboot() method is supposed to be available to applications?

SDK applications that are installed to the system partition as part of firmware can hold the REBOOT permission. Ordinary SDK applications cannot.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top