VancedMicroG/src/com/google/android/gms/location/LocationClient.java

68 lines
2.7 KiB
Java
Raw Normal View History

2015-01-15 19:11:31 +00:00
package com.google.android.gms.location;
2015-01-19 00:46:08 +00:00
import android.app.PendingIntent;
2015-01-15 19:11:31 +00:00
import android.content.Context;
2015-01-19 00:46:08 +00:00
import android.location.Location;
import android.os.Looper;
2015-01-15 19:11:31 +00:00
import com.google.android.gms.common.api.GoogleApiClient;
2015-01-19 00:46:08 +00:00
import com.google.android.gms.common.api.PendingResult;
2015-01-15 19:11:31 +00:00
import org.microg.gms.common.ForwardConnectionCallbacks;
import org.microg.gms.common.ForwardConnectionFailedListener;
2015-01-19 00:46:08 +00:00
import org.microg.gms.common.api.AbstractPlayServicesClient;
2015-01-15 19:11:31 +00:00
@Deprecated
2015-01-19 00:46:08 +00:00
public class LocationClient extends AbstractPlayServicesClient {
public static final String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION";
public LocationClient(Context context, ConnectionCallbacks callbacks,
OnConnectionFailedListener connectionFailedListener) {
2015-01-19 00:46:08 +00:00
super(new GoogleApiClient.Builder(context)
2015-01-15 19:11:31 +00:00
.addApi(LocationServices.API)
.addConnectionCallbacks(new ForwardConnectionCallbacks(callbacks))
.addOnConnectionFailedListener(new ForwardConnectionFailedListener
(connectionFailedListener))
2015-01-19 00:46:08 +00:00
.build());
2015-01-15 19:11:31 +00:00
}
2015-01-19 00:46:08 +00:00
public Location getLastLocation() {
return LocationServices.FusedLocationApi.getLastLocation(googleApiClient);
2015-01-15 19:11:31 +00:00
}
public PendingResult requestLocationUpdates(LocationRequest request,
LocationListener listener) {
return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request,
listener);
2015-01-15 19:11:31 +00:00
}
public PendingResult requestLocationUpdates(LocationRequest request,
LocationListener listener, Looper looper) {
return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request,
listener, looper);
2015-01-15 19:11:31 +00:00
}
public PendingResult requestLocationUpdates(LocationRequest request,
PendingIntent callbackIntent) {
return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request,
callbackIntent);
2015-01-15 19:11:31 +00:00
}
2015-01-19 00:46:08 +00:00
public PendingResult removeLocationUpdates(LocationListener listener) {
return LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, listener);
2015-01-15 19:11:31 +00:00
}
2015-01-19 00:46:08 +00:00
public PendingResult removeLocationUpdates(PendingIntent callbackIntent) {
return LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient,
callbackIntent);
2015-01-15 19:11:31 +00:00
}
2015-01-19 00:46:08 +00:00
public PendingResult setMockMode(boolean isMockMode) {
return LocationServices.FusedLocationApi.setMockMode(googleApiClient, isMockMode);
2015-01-15 19:11:31 +00:00
}
2015-01-19 00:46:08 +00:00
public PendingResult setMockLocation(Location mockLocation) {
return LocationServices.FusedLocationApi.setMockLocation(googleApiClient, mockLocation);
2015-01-15 19:11:31 +00:00
}
}