зеркало из https://github.com/mozilla/pjs.git
Bug 598508 - Fix geolocation on Android, r=dougt a=blocking-fennec
This commit is contained in:
Родитель
eda90713ee
Коммит
1e68daf74d
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче