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.