FORUMS

Alarm stats APPOPS_USAGE_STATS permission unknown

22 posts
Thanks Meter: 4
 
By mannixita, Junior Member on 18th September 2019, 07:03 AM
Post Reply Email Thread
Any idea why the alarm stats permission is unknown?
Phone is a Huawei P Smart 2019 with EMUI 9.1.0.264 (Android 9.0).

Code:
adb -d shell pm grant com.asksven.betterbatterystats android.permission.APPOPS_USAGE_STATS

Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown permission: android.permission.APPOPS_USAGE_STATS
        at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1417)
        at com.android.server.pm.permission.PermissionManagerService.access$900(PermissionManagerService.java:93)
        at com.android.server.pm.permission.PermissionManagerService$PermissionManagerInternalImpl.grantRuntimePermission(PermissionManagerService.java:2112)
        at com.android.server.pm.PackageManagerService.grantRuntimePermission(PackageManagerService.java:6057)
        at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:1773)
        at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:239)
        at android.os.ShellCommand.exec(ShellCommand.java:103)
        at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:23637)
        at android.os.Binder.shellCommand(Binder.java:642)
        at android.os.Binder.onTransact(Binder.java:540)
        at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2804)
        at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4427)
        at com.android.server.pm.HwPackageManagerService.onTransact(HwPackageManagerService.java:432)
        at android.os.Binder.execTransact(Binder.java:739)
The Following 2 Users Say Thank You to mannixita For This Useful Post: [ View ] Gift mannixita Ad-Free
29th December 2019, 08:35 AM |#2  
Junior Member
Thanks Meter: 7
 
More
After installing betterbatterystats_xdaedition_debug_2.5-341.apk I also had your exact error. Magisk was installed before installing the app. I started the app and granted the root permission in the Magisk popup.
The app weirdly still required two permissions (READ_PHONE_STATE and APPOPS_USAGE_STATS), which were shown with a red background in the app:
Quote:

$ sudo adb shell
[email protected]:/ $ su
[email protected]:/ # pm grant com.asksven.betterbatterystats_xdaedition android.permission.READ_PHONE_STATE

worked (I restarted phone and the red background color went away), but
Quote:

# pm grant com.asksven.betterbatterystats_xdaedition android.permission.APPOPS_USAGE_STATS

didn't work and the error you have came up. I solved it by clicking on the bottom "OK" error message on the app and rechecked [it was already set to the right/allow] the permissions slider.
The Following 3 Users Say Thank You to fdxw For This Useful Post: [ View ] Gift fdxw Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes