mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-11-19 02:29:25 +01:00
correctly announce fused location as "fused"
This commit is contained in:
parent
1eeeb0bcd3
commit
bee7bc9867
@ -91,16 +91,18 @@ public class LocationRequestHelper {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
lastReport = new Location(location);
|
||||
lastReport.setProvider("fused");
|
||||
Log.d(TAG, "sending Location: " + location);
|
||||
if (listener != null) {
|
||||
try {
|
||||
listener.onLocationChanged(location);
|
||||
listener.onLocationChanged(lastReport);
|
||||
} catch (RemoteException e) {
|
||||
return false;
|
||||
}
|
||||
} else if (pendingIntent != null) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("com.google.android.location.LOCATION", location);
|
||||
intent.putExtra("com.google.android.location.LOCATION", lastReport);
|
||||
try {
|
||||
pendingIntent.send(context, 0, intent);
|
||||
} catch (PendingIntent.CanceledException e) {
|
||||
@ -108,12 +110,11 @@ public class LocationRequestHelper {
|
||||
}
|
||||
} else if (callback != null) {
|
||||
try {
|
||||
callback.onLocationResult(LocationResult.create(Arrays.asList(location)));
|
||||
callback.onLocationResult(LocationResult.create(Arrays.asList(lastReport)));
|
||||
} catch (RemoteException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
lastReport = location;
|
||||
numReports++;
|
||||
return numReports < locationRequest.getNumUpdates();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user