Already set android.permissions.DEVICE_POWER in manifest of my app. Still complains that neither user nor process have this permission when I call PowerManager.gotoSleep(n) within activity. What other settings are required for this to work? Thanks This is on My Samsung ATT phone
Using android:keepScreenOn="true" is equivalent to using FLAG_KEEP_SCREEN_ON . You can use whichever approach is best for your app. The advantage of setting the flag programmatically in your activity is that it gives you the option of programmatically clearing the flag later and thereby allowing the screen to turn off.
DEVICE_POWER is a level 2 permission and protected permission and hence it is not provided to any app which request it via manifest, to get this permission successfully we need to have Platform certificate in our make file and shared user id set in manifest as system...
LOCAL_CERTIFICATE := platform (makefile entry)
android.uid.system (shared user id )
There isnt a way around this i have looked around havent found any ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With