From a06de0f29b58df9246779cc4bfd8f06f7205ddb6 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 11 Dec 2012 16:34:47 -0800 Subject: 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 --- location/java/android/location/ILocationManager.aidl | 2 +- location/java/android/location/LocationManager.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'location/java') diff --git a/location/java/android/location/ILocationManager.aidl b/location/java/android/location/ILocationManager.aidl index f663e0a04085..c353ec6efe46 100644 --- a/location/java/android/location/ILocationManager.aidl +++ b/location/java/android/location/ILocationManager.aidl @@ -47,7 +47,7 @@ interface ILocationManager Location getLastLocation(in LocationRequest request, String packageName); - boolean addGpsStatusListener(IGpsStatusListener listener); + boolean addGpsStatusListener(IGpsStatusListener listener, String packageName); void removeGpsStatusListener(IGpsStatusListener listener); boolean geocoderIsPresent(); diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java index 5a2f71b98c9b..0b9286ed62d5 100644 --- a/location/java/android/location/LocationManager.java +++ b/location/java/android/location/LocationManager.java @@ -1461,7 +1461,7 @@ public class LocationManager { } try { GpsStatusListenerTransport transport = new GpsStatusListenerTransport(listener); - result = mService.addGpsStatusListener(transport); + result = mService.addGpsStatusListener(transport, mContext.getPackageName()); if (result) { mGpsStatusListeners.put(listener, transport); } @@ -1507,7 +1507,7 @@ public class LocationManager { } try { GpsStatusListenerTransport transport = new GpsStatusListenerTransport(listener); - result = mService.addGpsStatusListener(transport); + result = mService.addGpsStatusListener(transport, mContext.getPackageName()); if (result) { mNmeaListeners.put(listener, transport); } -- cgit v1.2.3-59-g8ed1b