• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps PackageManager not granting permission?

v1nsai

Member
I'm writing a quick app that sends my phone into sleep when I turn the screen off, according to Spare Parts my phone has been awake more than 2x as long as the screen has actually been on >.<

It isn't working because PackageManager isn't letting me use the permission, it outputs
Code:
PackageManager: Not granting permission android.permission.DEVICE_POWER to package com.v1nsai.dataoff (protectionLevel=2 flags=0x44)

Is there a way to get this to run on a non-rooted phone?
 
To clarify, you're requesting the android.permission.DEVICE_POWER permission in your manifest and it's not allowing you to use it? If that's the case, I'm not sure if you can do anything about it on a non-rooted phone.
 
Back
Top Bottom