-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Added get_route api function & aidl get_position #9304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ATMI
wants to merge
13
commits into
osmandapp:master
Choose a base branch
from
ATMI:feature/aidl_ex
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f47eaf8
get_route api function
ATMI d16d530
aidl method stub to get location
ATMI b899b04
aidl output parameter as parcelable
ATMI 34261ca
APosition constructor params order fixed
ATMI 685e370
Merge remote-tracking branch 'origin/master' into feature/aidl_ex
ATMI 4a279ed
Merge remote-tracking branch 'osmandapp/master' into feature/aidl_ex
ATMI a219ef2
Order of AIDL methods rearranged; Added getCurrentRouteSegmentIndex()…
ATMI 1545783
Merge remote-tracking branch 'osmandapp/master' into feature/aidl_ex
ATMI 93c5901
get rid of duplicate class LatLonParcelable, use ALatLon instead; add…
ATMI ea341fa
Merge remote-tracking branch 'osmandapp/master' into feature/aidl_ex
ATMI 04c7327
getApplicationMode() aidl method added
ATMI 9c75003
Refactored due to https://github.com/osmandapp/OsmAnd/pull/9304#discu…
ATMI d5d8f1b
Merge remote-tracking branch 'osmandapp/master' into feature/aidl_ex
ATMI File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 APosition; |
This file contains hidden or 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,138 @@ | ||
| package net.osmand.aidlapi.map; | ||
|
|
||
| import android.os.Parcel; | ||
| import android.os.Parcelable; | ||
|
|
||
| public class APosition implements Parcelable { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in latest commit |
||
|
|
||
| public double getLatitude() { | ||
| return latitude; | ||
| } | ||
|
|
||
| public void setLatitude(double latitude) { | ||
| this.latitude = latitude; | ||
| } | ||
|
|
||
| public double getLongitude() { | ||
| return longitude; | ||
| } | ||
|
|
||
| public void setLongitude(double longitude) { | ||
| this.longitude = longitude; | ||
| } | ||
|
|
||
| public double getAltitude() { | ||
| return altitude; | ||
| } | ||
|
|
||
| public void setAltitude(double altitude) { | ||
| this.altitude = altitude; | ||
| } | ||
|
|
||
| public double getSpeed() { | ||
| return speed; | ||
| } | ||
|
|
||
| public void setSpeed(double speed) { | ||
| this.speed = speed; | ||
| } | ||
|
|
||
| public double getBearing() { | ||
| return bearing; | ||
| } | ||
|
|
||
| public void setBearing(double bearing) { | ||
| this.bearing = bearing; | ||
| } | ||
|
|
||
| private double latitude; | ||
| private double longitude; | ||
| private double altitude; | ||
| private double speed; | ||
| private double bearing; | ||
|
|
||
| public APosition(double latitude, double longitude, double altitude, double speed, double bearing) { | ||
| this.latitude = latitude; | ||
| this.longitude = longitude; | ||
| this.altitude = altitude; | ||
| this.speed = speed; | ||
| this.bearing = bearing; | ||
| } | ||
|
|
||
| public APosition(Parcel in) { | ||
| readFromParcel(in); | ||
| } | ||
|
|
||
| public static final Creator<APosition> CREATOR = new | ||
| Creator<APosition>() { | ||
| public APosition createFromParcel(Parcel in) { | ||
| return new APosition(in); | ||
| } | ||
|
|
||
| public APosition[] newArray(int size) { | ||
| return new APosition[size]; | ||
| } | ||
| }; | ||
|
|
||
| public APosition() { | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| final int prime = 31; | ||
| int result = 1; | ||
| int temp; | ||
| temp = (int)Math.floor(latitude * 10000); | ||
| result = prime * result + temp; | ||
| temp = (int)Math.floor(longitude * 10000); | ||
| result = prime * result + temp; | ||
| temp = (int)Math.floor(altitude * 10000); | ||
| result = prime * result + temp; | ||
| temp = (int)Math.floor(speed * 10000); | ||
| result = prime * result + temp; | ||
| temp = (int)Math.floor(bearing * 10000); | ||
| result = prime * result + temp; | ||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object obj) { | ||
| if (this == obj) | ||
| return true; | ||
| if (obj == null) | ||
| return false; | ||
| if (getClass() != obj.getClass()) | ||
| return false; | ||
|
|
||
| APosition other = (APosition) obj; | ||
| return Math.abs(latitude - other.latitude) < 0.00001 | ||
| && Math.abs(longitude - other.longitude) < 0.00001 | ||
| && Math.abs(altitude - other.altitude) < 1 | ||
| && Math.abs(speed - other.speed) < 1; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "Lat " + ((float)latitude) + " Lon " + ((float)longitude) + " Alt " + ((float)altitude); | ||
| } | ||
|
|
||
| public void writeToParcel(Parcel out, int flags) { | ||
| out.writeDouble(latitude); | ||
| out.writeDouble(longitude); | ||
| out.writeDouble(altitude); | ||
| out.writeDouble(speed); | ||
| out.writeDouble(bearing); | ||
| } | ||
|
|
||
| public void readFromParcel(Parcel in) { | ||
| latitude = in.readDouble(); | ||
| longitude = in.readDouble(); | ||
| altitude = in.readDouble(); | ||
| speed = in.readDouble(); | ||
| bearing = in.readDouble(); | ||
| } | ||
|
|
||
| public int describeContents() { | ||
| return 0; | ||
| } | ||
| } | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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.aidl.map; | ||
|
|
||
| parcelable APosition; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New aidl methods must be added to the end of the file or following methods will be broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, acknowledged )