Alarm stats APPOPS_USAGE_STATS permission unknown - BetterBatteryStats

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)

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:
$ sudo adb shell
[email protected]:/ $ su
[email protected]:/ # pm grant com.asksven.betterbatterystats_xdaedition android.permission.READ_PHONE_STATE
Click to expand...
Click to collapse
worked (I restarted phone and the red background color went away), but
# pm grant com.asksven.betterbatterystats_xdaedition android.permission.APPOPS_USAGE_STATS
Click to expand...
Click to collapse
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.

Having the same problem. Can't fix it...

Same here. On first installation and permissions configuration was working OK. Maybe it scanned the system further and noticed that it didnt have the proper permissions. Not rebooted yet. Probably will try to reboot and also I will read some thing in this forum.
Of course I enabled again all the USB debugging things and tried to add the permission, without success:
Code:
~\AppData\Local\Android\Sdk\platform-tools> .\adb.exe -d shell pm grant com.asksven.betterbatterystats_xdaedition android.permission.APPOPS_USAGE_STATS
Exception occurred while executing 'grant':
java.lang.IllegalArgumentException: Unknown permission: android.permission.APPOPS_USAGE_STATS
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermissionInternal(PermissionManagerService.java:1467)
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1426)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:2287)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:249)
at android.os.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:98)
at android.os.ShellCommand.exec(ShellCommand.java:44)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22207)
at android.os.Binder.shellCommand(Binder.java:932)
at android.os.Binder.onTransact(Binder.java:816)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:4687)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4419)
at android.os.Binder.execTransactInternal(Binder.java:1162)
at android.os.Binder.execTransact(Binder.java:1126)
But @fdxw solution solved it. However you should probably add your solution with more emphasis, I didnt see it the first time.
Solution
I solved it by clicking on the bottom "OK" error message on the app and rechecked it was already set to allow (disable it, enable it again) the permissions slider.
Click to expand...
Click to collapse

+1 Xiaomi Mi9

Related

Magisk/E: Unknown id: pm, with "pm uninstall" shell command

Hi, i have a Nexus 6P based on 7.1.1 with Magisk root v14.0 with Magisk manager v14.0.
With the terminal emulator app i'm trying to execute this commands:
Code:
su
pm uninstall org.telegram.messenger
But i got an error: Android.os.DeadObjectException: Transaction failed on small parcel; remote process probably died etc..
But if i connect my Nexus 6P to my pc, and via ADB i try to push this command
Code:
adb shell pm uninstall org.telegram.messenger
It works. I don't know if it's related to Magisk, but i tried to build an app made by that execute "pm uninstall org.telegram.messenger" after "su" to get root shell but nothing, i got only an error on my android monitor: "E/Magisk: Unknow id: pm" and obviously telegram has this package name and it is installed as user app. Someone can help me ?
smartandroidtech said:
Hi, i have a Nexus 6P based on 7.1.1 with Magisk root v14.0 with Magisk manager v14.0.
With the terminal emulator app i'm trying to execute this commands:
Code:
su
pm uninstall org.telegram.messenger
But i got an error: Android.os.DeadObjectException: Transaction failed on small parcel; remote process probably died etc..
But if i connect my Nexus 6P to my pc, and via ADB i try to push this command
Code:
adb shell pm uninstall org.telegram.messenger
It works. I don't know if it's related to Magisk, but i tried to build an app made by that execute "pm uninstall org.telegram.messenger" after "su" to get root shell but nothing, i got only an error on my android monitor: "E/Magisk: Unknow id: pm" and obviously telegram has this package name and it is installed as user app. Someone can help me ?
Click to expand...
Click to collapse
Are you able to uninstall the normal way thought settings>apps?
Sent from my H1611 using Tapatalk

Black shark helo play store error 190

Hi just to check how do i resolve play store error 190 for my black shark helo ?
Whenever i tried downloading games with large files, this error appear.
Appreciate for the advise, thank u
Hi I have resolve this problem with adb, you need grant permission storage,
adb shell
pm grant com.android.vending android.permission.WRITE_EXTERNAL_STORAGE
pm grant com.android.vending android.permission.READ_EXTERNAL_STORAGE
after reboot you have resolve your problem
Sime90ita said:
Hi I have resolve this problem with adb, you need grant permission storage,
Adb pm grant com.android.vending android.permission.WRITE_EXTERNAL_STORAGE
Adb pm grant com.android.vending android.permission.READ_EXTERNAL_STORAGE
after reboot you have resolve your problem
Click to expand...
Click to collapse
Thank you Sime90ita I have managed to run the adb command and everything is now working fine.
I had to modify the command by adding "shell" as below
Adb shell pm grant com.android.vending android.permission.WRITE_EXTERNAL_STORAGE
Adb shell pm grant com.android.vending android.permission.READ_EXTERNAL_STORAGE
All the best.
thanks for the report I will immediately correct my post
maroine80 said:
Thank you Sime90ita I have managed to run the adb command and everything is now working fine.
I had to modify the command by adding "shell" as below
Adb shell pm grant com.android.vending android.permission.WRITE_EXTERNAL_STORAGE
Adb shell pm grant com.android.vending android.permission.READ_EXTERNAL_STORAGE
All the best.
Click to expand...
Click to collapse
Hi, Can u do some tutorial on this, I also have the same problem.
keroro85 said:
Hi, Can u do some tutorial on this, I also have the same problem.
Click to expand...
Click to collapse
search "how to use adb" and use the commands listed above

unknown permission android.permission.write_secure_settings

Hello, I don't know if it's a good department, I have s10 + I have a problem with granting permissions by ADB. After entering the command the same problem every time I am looking for a solution but I have no ideas. Without root trying to give the program permission through the console, enter the command and the same thing at distant time.
List of devices attached
R58M608PQ4F device
C:\Users\rskor> adb shell pm grant com.leedroid.shortcutter android.premission.WRITE_SECURE_SETTINGS
Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown permission: android.premission.WRITE_SECURE_SETTINGS
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:2368)
at com.android.server.pm.permission.PermissionManagerService.access$1100(PermissionManagerService.java:131)
at com.android.server.pm.permission.PermissionManagerService$PermissionManagerInternalImpl.grantRuntimePermission(PermissionManagerService.java:3240)
at com.android.server.pm.PackageManagerService.grantRuntimePermission(PackageManagerService.java:6458)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:1730)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:217)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:25946)
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:3329)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4768)
at android.os.Binder.execTransact(Binder.java:739)
is that permission requested in the apps manifest? if not then you cant grant it
You now find "Disable permission monitoring" at the bottom of the developer options and turn it on

Reinstall/Enable the deleted/disabled com.amazon apps

Hi,
A long time ago I've followed a step-by-step tutorial to deactivate (almost) all Amazon apps so I can install Google Play and other custom apps on my kid's Kindle (7.1.2). Unfortunately, I don't have the link to that how to page. What I remember though, is that the script removed and disabled the apps.
What I need now is the Accessibility menu to appear in the Settings, and I think this is either com.amazon.settings or com.amazon.device.settings, both of them being disabled (ss seen after running the
Code:
pm list packaged -d
command.
1. This is what I have tried and the errors:
Code:
mustang:/ $ pm install com.amazon.settings
Error: failed to write; com.amazon.settings (No such file or directory)
1|mustang:/ $ pm install --user 0 "com.amazon.settings"
Error: failed to write; com.amazon.settings (No such file or directory)
1|mustang:/ $ pm enable --user 0 "com.amazon.settings"
Error: java.lang.SecurityException: Shell cannot change component state for com.amazon.settings/null to 1
1|mustang:/ $ pm enable com.amazon.settings
Error: java.lang.SecurityException: Shell cannot change component state for com.amazon.settings/null to 1
2. I've also searched for the .apks to download and install manually, but I think Amazon hides them very well 'cause googling didn't lead to any positive results.
So, if you know how to do this, or have any idea that might work, please advice. If it helps, the only reason I want to do this is because I am trying to set the Microsoft Launcher for my kid's tablet, and this needs the accessibility permission that cannot be enabled because the " App isn't installed". Also,
3. I have installed the Android Accessibility Suite directly from the Google Play, but it doesn't appear in thee Settings as in a normal Android device. So I believe the Kindle needs the original Amazon's settings for this to work.
Again, any help is appreciated.

Can't give adb permissions

Hi, I just bought the app on Playstore. I'm on a unrooted Oneplus 3T and I can't give permission with the command lines written on the app.
This is the error
Code:
C:\Android>adb -d shell pm grant com.askven.betterbatterystats android.permission.BATTERY_STATS
Exception occurred while executing:
java.lang.IllegalArgumentException: Unknown package: com.askven.betterbatterystats
at com.android.server.pm.permission.PermissionManagerService.grantRuntimePermission(PermissionManagerService.java:1423)
at com.android.server.pm.permission.PermissionManagerService.access$900(PermissionManagerService.java:91)
at com.android.server.pm.permission.PermissionManagerService$PermissionManagerInternalImpl.grantRuntimePermission(PermissionManagerService.java:2133)
at com.android.server.pm.PackageManagerService.grantRuntimePermission(PackageManagerService.java:6022)
at com.android.server.pm.PackageManagerShellCommand.runGrantRevokePermission(PackageManagerShellCommand.java:1735)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:222)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22626)
at android.os.Binder.shellCommand(Binder.java:655)
at android.os.Binder.onTransact(Binder.java:553)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2854)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4325)
at android.os.Binder.execTransact(Binder.java:752)
probably the OP has solved it already, but mentioning for future reference since I got the same errors.
I've used the app ADB AppControl, you get a list of the apps and then you can click to enable/disable permissions.
ADB AppControl
Official website of the ADB AppControl application. Free Download. Latest release. The ultimate applications manager and debloat tool for Android devices.
adbappcontrol.com

Categories

Resources