[android] Fixed crash when creating RoutePointInfo from JNI.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako
2025-05-20 11:31:56 -03:00
committed by Konstantin Pastbin
parent 690ca53677
commit 28455e51a6

View File

@@ -30,6 +30,21 @@ public final class RoutePointInfo implements Parcelable
public final int mIntermediateIndex; public final int mIntermediateIndex;
// Called from JNI.
@Keep
public RoutePointInfo(int markType, int intermediateIndex)
{
switch (markType)
{
case 0: mMarkType = RouteMarkType.Start; break;
case 1: mMarkType = RouteMarkType.Intermediate; break;
case 2: mMarkType = RouteMarkType.Finish; break;
default: throw new IllegalArgumentException("Mark type is not valid = " + markType);
}
mIntermediateIndex = intermediateIndex;
}
private RoutePointInfo(@NonNull RouteMarkType markType, int intermediateIndex) private RoutePointInfo(@NonNull RouteMarkType markType, int intermediateIndex)
{ {
mMarkType = markType; mMarkType = markType;