Skip to content
Commit 3875bf6c authored by Snild Dolkow's avatar Snild Dolkow Committed by Zoran Jovanovic
Browse files

Handle 'root' pseudo-package in the appops command

The AppOpsService handles the 'root' pseudo-package as any other; it
gets no automatic allowances. This is reasonable, but it blocked me from
accessing the mms-sms provider through the 'content' command, even in a
root shell.

So I tried to change the rules:

$ adb root
$ adb shell appops set root WRITE_SMS allow
Error: No UID for root in user 0

This error occurs in the appops command because there isn't really a
package called root, so the UID lookup via PackageManager fails.

But we know that root is UID 0, so we can just skip the lookup.
(Also, AppOpsService handles the other way around in getOpsLocked method.)

Change-Id: Ie0cad67efa438a74a4d9921d29933610cfb13974
parent c9390c8b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment