I am developing an application for Android 1.6 and newer that contains functionality that puts the phone in sleep mode.
I tried to find a way how to do this, and found the goToSleep method in the PowerManager class , but unfortunately android.permission.DEVICE_POWER is required to use this method , system level permission is allowed only for system applications.
Does anyone know an alternative way to make the phone go into sleep mode or how to sign an application to get the above permission and allow the use of the goToSleep method ? Thank!
source
share