Pass the WebView context to the GeolocationService from WebKit

Bug: 2798745
Change-Id: I53e7c5f9ac1cf017a6f7d83e6d0fd57bc1d3403a
This commit is contained in:
Steve Block
2010-06-28 10:26:39 +01:00
parent 26ae3b66e5
commit 074c08c4eb

View File

@@ -45,14 +45,13 @@ final class GeolocationService implements LocationListener {
/**
* Constructor
* @param context The context from which we obtain the system service.
* @param nativeObject The native object to which this object will report position updates and
* errors.
*/
public GeolocationService(long nativeObject) {
public GeolocationService(Context context, long nativeObject) {
mNativeObject = nativeObject;
// Register newLocationAvailable with platform service.
ActivityThread thread = ActivityThread.systemMain();
Context context = thread.getApplication();
mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
if (mLocationManager == null) {
Log.e(TAG, "Could not get location manager.");