forked from osmandapp/OsmAnd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aidl method stub to get location aidl output parameter as parcelable APosition constructor params order fixed Order of AIDL methods rearranged; Added getCurrentRouteSegmentIndex() & getRouteCreationTime(); get rid of duplicate class LatLonParcelable, use ALatLon instead; added getRoute() aidl api method; added getRoutePoints() aidl method getApplicationMode() aidl method added Refactored due to osmandapp#9304 (comment) && osmandapp#9304 (comment)
- Loading branch information
1 parent
5cecf2a
commit e9f582e
Showing
22 changed files
with
1,341 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
OsmAnd-api/src/net/osmand/aidlapi/calculateroute/CalculatedRoute.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package net.osmand.aidlapi.calculateroute; | ||
|
||
parcelable CalculatedRoute; |
133 changes: 133 additions & 0 deletions
133
OsmAnd-api/src/net/osmand/aidlapi/calculateroute/CalculatedRoute.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
package net.osmand.aidlapi.calculateroute; | ||
|
||
import android.os.Bundle; | ||
import android.os.Parcel; | ||
|
||
import net.osmand.aidlapi.AidlParams; | ||
import net.osmand.aidlapi.map.ALatLon; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class CalculatedRoute extends AidlParams { | ||
|
||
private boolean isRouteCalculated; | ||
|
||
private String appMode; | ||
|
||
private ArrayList<ALatLon> routePoints; | ||
private int routeDistance; | ||
|
||
private float routingTime; | ||
private long creationTime; | ||
|
||
private float calculationTime; | ||
|
||
public CalculatedRoute() { | ||
|
||
} | ||
|
||
public CalculatedRoute(boolean isRouteCalculated, String appMode, ArrayList<ALatLon> routePoints, int routeDistance, float routingTime, long creationTime, float calculationTime) { | ||
this.isRouteCalculated = isRouteCalculated; | ||
this.appMode = appMode; | ||
this.routePoints = routePoints; | ||
this.routeDistance = routeDistance; | ||
this.routingTime = routingTime; | ||
this.creationTime = creationTime; | ||
this.calculationTime = calculationTime; | ||
} | ||
|
||
protected CalculatedRoute(Parcel in) { | ||
readFromParcel(in); | ||
} | ||
|
||
public static final Creator<CalculatedRoute> CREATOR = new Creator<CalculatedRoute>() { | ||
@Override | ||
public CalculatedRoute createFromParcel(Parcel in) { | ||
return new CalculatedRoute(in); | ||
} | ||
|
||
@Override | ||
public CalculatedRoute[] newArray(int size) { | ||
return new CalculatedRoute[size]; | ||
} | ||
}; | ||
|
||
public boolean isRouteCalculated() { | ||
return isRouteCalculated; | ||
} | ||
|
||
public String getAppMode() { | ||
return appMode; | ||
} | ||
|
||
public ArrayList<ALatLon> getRoutePoints() { | ||
return routePoints; | ||
} | ||
|
||
public int getRouteDistance() { | ||
return routeDistance; | ||
} | ||
|
||
public float getRoutingTime() { | ||
return routingTime; | ||
} | ||
|
||
public long getCreationTime() { | ||
return creationTime; | ||
} | ||
|
||
public float getCalculationTime() { | ||
return calculationTime; | ||
} | ||
|
||
public void setRouteCalculated(boolean routeCalculated) { | ||
isRouteCalculated = routeCalculated; | ||
} | ||
|
||
public void setAppMode(String appMode) { | ||
this.appMode = appMode; | ||
} | ||
|
||
public void setRoutePoints(ArrayList<ALatLon> routePoints) { | ||
this.routePoints = routePoints; | ||
} | ||
|
||
public void setRouteDistance(int routeDistance) { | ||
this.routeDistance = routeDistance; | ||
} | ||
|
||
public void setRoutingTime(float routingTime) { | ||
this.routingTime = routingTime; | ||
} | ||
|
||
public void setCreationTime(long creationTime) { | ||
this.creationTime = creationTime; | ||
} | ||
|
||
public void setCalculationTime(float calculationTime) { | ||
this.calculationTime = calculationTime; | ||
} | ||
|
||
@Override | ||
protected void readFromBundle(Bundle bundle) { | ||
bundle.setClassLoader(ALatLon.class.getClassLoader()); | ||
isRouteCalculated = bundle.getBoolean("isRouteCalculated"); | ||
appMode = bundle.getString("appMode"); | ||
routePoints = bundle.getParcelableArrayList("routePoints"); | ||
routeDistance = bundle.getInt("routeDistance"); | ||
routingTime = bundle.getFloat("routingTime"); | ||
creationTime = bundle.getLong("creationTime"); | ||
calculationTime = bundle.getFloat("calculationTime"); | ||
} | ||
|
||
@Override | ||
protected void writeToBundle(Bundle bundle) { | ||
bundle.putBoolean("isRouteCalculated", isRouteCalculated); | ||
bundle.putString("appMode", appMode); | ||
bundle.putParcelableArrayList("routePoints", routePoints); | ||
bundle.putInt("routeDistance", routeDistance); | ||
bundle.putFloat("routingTime", routingTime); | ||
bundle.putLong("creationTime", creationTime); | ||
bundle.putFloat("calculationTime", calculationTime); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package net.osmand.aidlapi.map; | ||
|
||
parcelable ALocationType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package net.osmand.aidlapi.map; | ||
|
||
import android.os.Parcel; | ||
import android.os.Parcelable; | ||
|
||
public enum ALocationType implements Parcelable { | ||
CURRENT(0), | ||
PROJECTION(1), | ||
ROUTE_END(2), | ||
; | ||
|
||
final int value; | ||
|
||
ALocationType(int value) { | ||
this.value = value; | ||
} | ||
|
||
public static final Creator<ALocationType> CREATOR = new Creator<ALocationType>() { | ||
@Override | ||
public ALocationType createFromParcel(Parcel in) { | ||
return ALocationType.valueOf(in.readString()); | ||
} | ||
|
||
@Override | ||
public ALocationType[] newArray(int size) { | ||
return new ALocationType[size]; | ||
} | ||
}; | ||
|
||
public int getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public int describeContents() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void writeToParcel(Parcel dest, int flags) { | ||
dest.writeString(name()); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
OsmAnd-api/src/net/osmand/aidlapi/navigation/NavigationStatus.aidl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package net.osmand.aidlapi.navigation; | ||
|
||
parcelable NavigationStatus; |
Oops, something went wrong.