diff options
| author | Dianne Hackborn <hackbod@google.com> | 2012-12-11 16:34:47 -0800 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2013-01-09 12:47:47 -0800 |
| commit | a06de0f29b58df9246779cc4bfd8f06f7205ddb6 (patch) | |
| tree | c8ecd3323c1112dd46a9470600eab5df022ca85c /core/java/android/content | |
| parent | 2e9f65f978397d112dbfb134d374588515bb644a (diff) | |
New "app ops" service.
Initial implementation, tracking use of the vibrator, GPS,
and location reports.
Also includes an update to battery stats to also keep track of
vibrator usage (since I had to be in the vibrator code anyway
to instrument it).
The service itself is only half-done. Currently no API to
retrieve the data (which once there will allow us to show you
which apps are currently causing the GPS to run and who has
recently accessed your location), it doesn't persist its data
like it should, and no way to tell it to reject app requests
for various operations.
But hey, it's a start!
Change-Id: I05b8d76cc4a4f7f37bc758c1701f51f9e0550e15
Diffstat (limited to 'core/java/android/content')
| -rw-r--r-- | core/java/android/content/Context.java | 12 | ||||
| -rw-r--r-- | core/java/android/content/pm/PackageManager.java | 16 |
2 files changed, 28 insertions, 0 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 257f84ef8e94..c777250743b6 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -2289,6 +2289,18 @@ public abstract class Context { public static final String USER_SERVICE = "user"; /** + * Use with {@link #getSystemService} to retrieve a + * {@link android.app.AppOpsManager} for tracking application operations + * on the device. + * + * @see #getSystemService + * @see android.app.AppOpsManager + * + * @hide + */ + public static final String APP_OPS_SERVICE = "appops"; + + /** * Determine whether the given permission is allowed for a particular * process and user ID running in the system. * diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 8ba19881f097..cdd91951387c 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -1280,6 +1280,22 @@ public abstract class PackageManager { throws NameNotFoundException; /** + * @hide Return the uid associated with the given package name for the + * given user. + * + * <p>Throws {@link NameNotFoundException} if a package with the given + * name can not be found on the system. + * + * @param packageName The full name (i.e. com.google.apps.contacts) of the + * desired package. + * @param userHandle The user handle identifier to look up the package under. + * + * @return Returns an integer uid who owns the given package name. + */ + public abstract int getPackageUid(String packageName, int userHandle) + throws NameNotFoundException; + + /** * Retrieve all of the information we know about a particular permission. * * <p>Throws {@link NameNotFoundException} if a permission with the given |
