am b84138c7: Merge change 23806 into eclair

Merge commit 'b84138c72c94f189d4656451097b90f86d751731' into eclair-plus-aosp

* commit 'b84138c72c94f189d4656451097b90f86d751731':
  Handle security exception when Geolocation registers with system location service in DumpRenderTree.
This commit is contained in:
Steve Block
2009-09-03 09:26:05 -07:00
committed by Android Git Automerger

View File

@@ -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.");
}
}