mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-26 03:46:49 +01:00
make use of onSetNavigationInfo() in osmand receiver.
This is not implemented anywhere, purely preparing for further experiments
This commit is contained in:
parent
48dee7486f
commit
d7e2f1ff8c
@ -24,6 +24,8 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.model.NavigationInfoSpec;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
||||||
|
|
||||||
public class OsmandEventReceiver {
|
public class OsmandEventReceiver {
|
||||||
@ -35,6 +37,8 @@ public class OsmandEventReceiver {
|
|||||||
private final Application app;
|
private final Application app;
|
||||||
private IOsmAndAidlInterface mIOsmAndAidlInterface;
|
private IOsmAndAidlInterface mIOsmAndAidlInterface;
|
||||||
|
|
||||||
|
private NavigationInfoSpec navigationInfoSpec = new NavigationInfoSpec();
|
||||||
|
|
||||||
private final IOsmAndAidlCallback.Stub mIOsmAndAidlCallback = new IOsmAndAidlCallback.Stub() {
|
private final IOsmAndAidlCallback.Stub mIOsmAndAidlCallback = new IOsmAndAidlCallback.Stub() {
|
||||||
@Override
|
@Override
|
||||||
public void onSearchComplete(List<SearchResult> resultSet) {
|
public void onSearchComplete(List<SearchResult> resultSet) {
|
||||||
@ -54,6 +58,10 @@ public class OsmandEventReceiver {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateNavigationInfo(ADirectionInfo directionInfo) {
|
public void updateNavigationInfo(ADirectionInfo directionInfo) {
|
||||||
|
navigationInfoSpec.nextAction = directionInfo.getTurnType();
|
||||||
|
navigationInfoSpec.distanceToTurn = directionInfo.getDistanceTo();
|
||||||
|
GBApplication.deviceService().onSetNavigationInfo(navigationInfoSpec);
|
||||||
|
|
||||||
LOG.error("Distance: " + directionInfo.getDistanceTo() + " turnType: " + directionInfo.getTurnType());
|
LOG.error("Distance: " + directionInfo.getDistanceTo() + " turnType: " + directionInfo.getTurnType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,11 +71,13 @@ public class OsmandEventReceiver {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onVoiceRouterNotify(OnVoiceNavigationParams params) {
|
public void onVoiceRouterNotify(OnVoiceNavigationParams params) {
|
||||||
List<String> played = params.getPlayed();
|
List<String> played = params.getPlayed();
|
||||||
for (String play : played) {
|
for (String instuction : played) {
|
||||||
LOG.error("played: " + play);
|
navigationInfoSpec.instruction = instuction;
|
||||||
|
LOG.error("instruction: " + instuction);
|
||||||
|
// only first one for now
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user