Bug 598508 - Fix geolocation on Android, r=dougt a=blocking-fennec

This commit is contained in:
Michael Wu 2010-09-21 19:36:58 -07:00
Родитель eda90713ee
Коммит 1e68daf74d
3 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -511,7 +511,7 @@ bool
ContentChild::RecvGeolocationUpdate(const GeoPosition& somewhere)
{
nsCOMPtr<nsIGeolocationUpdate> gs = do_GetService("@mozilla.org/geolocation/service;1");
if (gs) {
if (!gs) {
return true;
}
nsCOMPtr<nsIDOMGeoPosition> position = somewhere;

Просмотреть файл

@ -77,8 +77,8 @@ NS_INTERFACE_MAP_ENTRY(nsIDOMGeoPositionAddress)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(GeoPositionAddress)
NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(nsGeoPositionAddress)
NS_IMPL_RELEASE(nsGeoPositionAddress)
NS_IMPL_THREADSAFE_ADDREF(nsGeoPositionAddress)
NS_IMPL_THREADSAFE_RELEASE(nsGeoPositionAddress)
NS_IMETHODIMP
nsGeoPositionAddress::GetStreetNumber(nsAString & aStreetNumber)
@ -172,8 +172,8 @@ NS_INTERFACE_MAP_ENTRY(nsIDOMGeoPositionCoords)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(GeoPositionCoords)
NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(nsGeoPositionCoords)
NS_IMPL_RELEASE(nsGeoPositionCoords)
NS_IMPL_THREADSAFE_ADDREF(nsGeoPositionCoords)
NS_IMPL_THREADSAFE_RELEASE(nsGeoPositionCoords)
NS_IMETHODIMP
nsGeoPositionCoords::GetLatitude(double *aLatitude)
@ -269,8 +269,8 @@ NS_INTERFACE_MAP_ENTRY(nsIDOMGeoPosition)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(GeoPosition)
NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(nsGeoPosition)
NS_IMPL_RELEASE(nsGeoPosition)
NS_IMPL_THREADSAFE_ADDREF(nsGeoPosition)
NS_IMPL_THREADSAFE_RELEASE(nsGeoPosition)
NS_IMETHODIMP
nsGeoPosition::GetTimestamp(DOMTimeStamp* aTimestamp)

Просмотреть файл

@ -322,7 +322,9 @@ class GeckoAppShell
if (provider == null)
return;
sendEventToGecko(new GeckoEvent(lm.getLastKnownLocation(provider)));
Location loc = lm.getLastKnownLocation(provider);
if (loc != null)
sendEventToGecko(new GeckoEvent(loc));
lm.requestLocationUpdates(provider, 100, (float).5, GeckoApp.surfaceView, Looper.getMainLooper());
} else {
lm.removeUpdates(GeckoApp.surfaceView);