문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top