Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP brainflakes

12th January 2014, 05:49 PM   |  #1  
OP Junior Member
Thanks Meter: 6
 
12 posts
Join Date:Joined: May 2013
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

Tags
privacy guard, rom development, slimkat
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes