diff options
author | Mike Lockwood <lockwood@android.com> | 2010-03-17 23:19:25 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2010-04-04 18:44:05 -0400 |
commit | 79e642e8ed75033eacc461633a8f4cd5157d25df (patch) | |
tree | ebc3346802f4868d9dae41e10003b2c0e893d2b7 /location | |
parent | a9d0771377a1208cfaab7c7b2bf68332ab370f49 (diff) | |
download | frameworks_base-79e642e8ed75033eacc461633a8f4cd5157d25df.zip frameworks_base-79e642e8ed75033eacc461633a8f4cd5157d25df.tar.gz frameworks_base-79e642e8ed75033eacc461633a8f4cd5157d25df.tar.bz2 |
Call LocationManager.sendNiResponse() instead of calling directly to GpsLocationProvider
Change-Id: I6a5b47abb0519f5228d29bc3340bb2490564803e
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'location')
-rwxr-xr-x | location/java/com/android/internal/location/GpsLocationProvider.java | 2 | ||||
-rwxr-xr-x | location/java/com/android/internal/location/GpsNetInitiatedHandler.java | 15 |
2 files changed, 6 insertions, 11 deletions
diff --git a/location/java/com/android/internal/location/GpsLocationProvider.java b/location/java/com/android/internal/location/GpsLocationProvider.java index 15d692c..e312482 100755 --- a/location/java/com/android/internal/location/GpsLocationProvider.java +++ b/location/java/com/android/internal/location/GpsLocationProvider.java @@ -348,7 +348,7 @@ public class GpsLocationProvider implements LocationProviderInterface { public GpsLocationProvider(Context context, ILocationManager locationManager) { mContext = context; mLocationManager = locationManager; - mNIHandler = new GpsNetInitiatedHandler(context, this); + mNIHandler = new GpsNetInitiatedHandler(context); mLocation.setExtras(mLocationExtras); diff --git a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java index a5466d1..2a6618b 100755 --- a/location/java/com/android/internal/location/GpsNetInitiatedHandler.java +++ b/location/java/com/android/internal/location/GpsNetInitiatedHandler.java @@ -23,6 +23,7 @@ import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; +import android.location.LocationManager; import android.os.Bundle; import android.os.RemoteException; import android.util.Log; @@ -81,7 +82,7 @@ public class GpsNetInitiatedHandler { private final Context mContext; // parent gps location provider - private final GpsLocationProvider mGpsLocationProvider; + private final LocationManager mLocationManager; // configuration of notificaiton behavior private boolean mPlaySounds = false; @@ -122,9 +123,9 @@ public class GpsNetInitiatedHandler { */ private Notification mNiNotification; - public GpsNetInitiatedHandler(Context context, GpsLocationProvider gpsLocationProvider) { + public GpsNetInitiatedHandler(Context context) { mContext = context; - mGpsLocationProvider = gpsLocationProvider; + mLocationManager = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE); } // Handles NI events from HAL @@ -157,13 +158,7 @@ public class GpsNetInitiatedHandler { !notif.needNotify && !notif.needVerify || notif.privacyOverride) { - try { - mGpsLocationProvider.getNetInitiatedListener().sendNiResponse(notif.notificationId, GPS_NI_RESPONSE_ACCEPT); - } - catch (RemoteException e) - { - Log.e(TAG, e.getMessage()); - } + mLocationManager.sendNiResponse(notif.notificationId, GPS_NI_RESPONSE_ACCEPT); } ////////////////////////////////////////////////////////////////////////// |