• 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
Mar 24, 2010
60
3
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?
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones