You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
LocationManager: expose more information from the backend to the apps
note: GnssStatus was accidentally bundled into ab5b600bf1
This commit is contained in:
@@ -4,12 +4,27 @@ public class Location {
|
||||
|
||||
private double latitude;
|
||||
private double longitude;
|
||||
private double altitude;
|
||||
private double accuracy;
|
||||
private double speed;
|
||||
private double bearing;
|
||||
private long timestamp;
|
||||
|
||||
public Location (double latitude, double longitude, double bearing) {
|
||||
/* for internal use */
|
||||
public Location (double latitude,
|
||||
double longitude,
|
||||
double altitude,
|
||||
double accuracy,
|
||||
double speed,
|
||||
double bearing,
|
||||
long timestamp) {
|
||||
this.latitude = latitude;
|
||||
this.longitude = longitude;
|
||||
this.altitude = altitude;
|
||||
this.accuracy = accuracy;
|
||||
this.speed = speed;
|
||||
this.bearing = bearing;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
@@ -20,8 +35,43 @@ public class Location {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public double getBearing() {
|
||||
return bearing;
|
||||
public boolean hasAltitude() {
|
||||
return altitude != -Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
public double getAltitude() {
|
||||
return altitude;
|
||||
}
|
||||
|
||||
public boolean hasAccuracy() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public float getAccuracy() {
|
||||
return (float)accuracy;
|
||||
}
|
||||
|
||||
public boolean hasSpeed() {
|
||||
return speed != -1;
|
||||
}
|
||||
|
||||
public float getSpeed() {
|
||||
return (float)speed;
|
||||
}
|
||||
|
||||
public boolean hasBearing() {
|
||||
return bearing != -1;
|
||||
}
|
||||
|
||||
public float getBearing() {
|
||||
return (float)bearing;
|
||||
}
|
||||
|
||||
public long getTime() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public String getProvider() {
|
||||
return "fused";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user