mirror of
https://github.com/YTVanced/VancedMicroG
synced 2024-11-01 00:42:39 +00:00
Fix/Suppress Lint errors
This commit is contained in:
parent
f8210c6edc
commit
d6d32cc203
2 changed files with 6 additions and 8 deletions
|
@ -25,7 +25,7 @@ import com.google.android.gms.common.api.Result;
|
||||||
import com.google.android.gms.common.api.ResultCallback;
|
import com.google.android.gms.common.api.ResultCallback;
|
||||||
|
|
||||||
class ResultCallbackHandler<R extends Result> extends Handler {
|
class ResultCallbackHandler<R extends Result> extends Handler {
|
||||||
private static final String TAG = "GmsResultCallbackHandler";
|
private static final String TAG = "GmsResultCbackHandler";
|
||||||
public static final int CALLBACK_ON_COMPLETE = 1;
|
public static final int CALLBACK_ON_COMPLETE = 1;
|
||||||
public static final int CALLBACK_ON_TIMEOUT = 2;
|
public static final int CALLBACK_ON_TIMEOUT = 2;
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ import com.google.android.gms.location.LocationRequest;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@SuppressWarnings("MissingPermission")
|
||||||
public class NativeLocationClientImpl {
|
public class NativeLocationClientImpl {
|
||||||
private final static String TAG = "GmsToNativeLocClient";
|
private final static String TAG = "GmsToNativeLocClient";
|
||||||
private final static Criteria DEFAULT_CRITERIA = new Criteria();
|
private final static Criteria DEFAULT_CRITERIA = new Criteria();
|
||||||
|
@ -72,8 +73,7 @@ public class NativeLocationClientImpl {
|
||||||
|
|
||||||
public Location getLastLocation() {
|
public Location getLastLocation() {
|
||||||
Log.d(TAG, "getLastLocation()");
|
Log.d(TAG, "getLastLocation()");
|
||||||
return locationManager.getLastKnownLocation(
|
return locationManager.getLastKnownLocation(locationManager.getBestProvider(DEFAULT_CRITERIA, true));
|
||||||
locationManager.getBestProvider(DEFAULT_CRITERIA, true));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void requestLocationUpdates(LocationRequest request, LocationListener listener) {
|
public void requestLocationUpdates(LocationRequest request, LocationListener listener) {
|
||||||
|
@ -88,9 +88,8 @@ public class NativeLocationClientImpl {
|
||||||
i.putExtras(bundle);
|
i.putExtras(bundle);
|
||||||
pendingCount.put(pendingIntent, request.getNumUpdates());
|
pendingCount.put(pendingIntent, request.getNumUpdates());
|
||||||
nativePendingMap.put(pendingIntent, PendingIntent.getActivity(context, 0, i, 0));
|
nativePendingMap.put(pendingIntent, PendingIntent.getActivity(context, 0, i, 0));
|
||||||
locationManager.requestLocationUpdates(request.getInterval(),
|
locationManager.requestLocationUpdates(request.getInterval(), request.getSmallestDesplacement(),
|
||||||
request.getSmallestDesplacement(), makeNativeCriteria(request),
|
makeNativeCriteria(request), nativePendingMap.get(pendingIntent));
|
||||||
nativePendingMap.get(pendingIntent));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void requestLocationUpdates(LocationRequest request, LocationListener listener, Looper
|
public void requestLocationUpdates(LocationRequest request, LocationListener listener, Looper
|
||||||
|
@ -133,8 +132,7 @@ public class NativeLocationClientImpl {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (intent.hasExtra(LocationManager.KEY_LOCATION_CHANGED)) {
|
if (intent.hasExtra(LocationManager.KEY_LOCATION_CHANGED)) {
|
||||||
PendingIntent pendingIntent = intent.getExtras().getParcelable
|
PendingIntent pendingIntent = intent.getExtras().getParcelable(EXTRA_PENDING_INTENT);
|
||||||
(EXTRA_PENDING_INTENT);
|
|
||||||
try {
|
try {
|
||||||
intent.putExtra(FusedLocationProviderApi.KEY_LOCATION_CHANGED,
|
intent.putExtra(FusedLocationProviderApi.KEY_LOCATION_CHANGED,
|
||||||
intent.getParcelableExtra(LocationManager.KEY_LOCATION_CHANGED));
|
intent.getParcelableExtra(LocationManager.KEY_LOCATION_CHANGED));
|
||||||
|
|
Loading…
Reference in a new issue