From 4afcd2e9d65f67a06e5afb4140b909885ebe2e1c Mon Sep 17 00:00:00 2001 From: Steve Block Date: Thu, 3 Sep 2009 11:41:29 +0100 Subject: Handle security exception when Geolocation registers with system location service in DumpRenderTree. --- core/java/android/webkit/GeolocationService.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'core/java/android/webkit/GeolocationService.java') diff --git a/core/java/android/webkit/GeolocationService.java b/core/java/android/webkit/GeolocationService.java index 78b25ba1cb6b..646f8c507d36 100755 --- a/core/java/android/webkit/GeolocationService.java +++ b/core/java/android/webkit/GeolocationService.java @@ -156,11 +156,16 @@ public final class GeolocationService implements LocationListener { * Registers this object with the location service. */ private void registerForLocationUpdates() { - mLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this); - mIsNetworkProviderAvailable = true; - if (mIsGpsEnabled) { - mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this); - mIsGpsProviderAvailable = true; + try { + mLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this); + mIsNetworkProviderAvailable = true; + if (mIsGpsEnabled) { + mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this); + mIsGpsProviderAvailable = true; + } + } catch(SecurityException e) { + Log.e(TAG, "Caught security exception registering for location updates from system. " + + "This should only happen in DumpRenderTree."); } } -- cgit v1.2.3