Remove All Ads from XDA
Honor View 10

How to read app's Privacy Guard status (Rom/AppOps integrated version)

12 posts
Thanks Meter: 7
By brainflakes, Junior Member on 12th January 2014, 05:49 PM
Post Reply Email Thread
Hi guys, I've recently started a personal project to extend the Privacy Guard feature of several custom roms to block certain methods of READ_PHONE_STATE when enabled (eg. getLine1Number)

Since I last looked at the Privacy Guard code it seems to have been integrated into the AppOpsService, and I'm at a loss as how to read the privacy guard status of an app inside framework code to block specific framework methods (blocking the READ_PHONE_STATE permission entirely isn't desirable as there are genuinely useful methods such as detecting phone calls etc)

Given the application context (context.getApplicationContext()) is available in the TelephonyManager class I should be able to check whether privacy guard is enabled for that app in methods I'd like to mask, but I don't know app ops well enough to do this. Does anyone have any examples or pointers? Thanks!

I'm currently working with the Simroms KitKat source, but IIRC the Privacy Guard code was merged from CM.
Post Reply Subscribe to Thread

privacy guard, rom development, slimkat

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

Advanced Search
Display Modes