зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1214554 - Implement getLocationListener on GeckoInterface r=reuben
This commit is contained in:
Родитель
a3df26a7d2
Коммит
d819fec749
|
@ -14,6 +14,8 @@ import android.content.Context;
|
|||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.location.Location;
|
||||
import android.location.LocationListener;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.util.Log;
|
||||
|
@ -53,6 +55,34 @@ public class Launcher extends FragmentActivity
|
|||
private long mLastHome;
|
||||
private long mHomeCount;
|
||||
|
||||
final class GeckoInterface extends BaseGeckoInterface
|
||||
implements LocationListener {
|
||||
public GeckoInterface(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public LocationListener getLocationListener() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(Location location) {
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createLocationEvent(location));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProviderDisabled(String provider) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProviderEnabled(String provider) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||
}
|
||||
}
|
||||
|
||||
/** ContextGetter */
|
||||
public Context getContext() {
|
||||
return this;
|
||||
|
@ -92,7 +122,7 @@ public class Launcher extends FragmentActivity
|
|||
|
||||
initGecko();
|
||||
|
||||
GeckoAppShell.setGeckoInterface(new BaseGeckoInterface(this));
|
||||
GeckoAppShell.setGeckoInterface(new GeckoInterface(this));
|
||||
|
||||
UpdateServiceHelper.registerForUpdates(this);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче