Skip to content
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

[android-auto] Fix some bugs #7671

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

AndrewShkrob
Copy link
Member

@AndrewShkrob AndrewShkrob commented Mar 23, 2024

Closes: #7470

Fixed a bug with the routing controller detached when switching from the device to the car screen

How to test:

  • Build a route on the phone
  • Switch to AA
  • My position point should be at the bottom (1st bug)
  • Try to stop navigation (2nd bug)

Signed-off-by: Andrew Shkrob <andrew.shkrob.social@yandex.by>
@@ -220,7 +220,7 @@ public void enable()
mMap.onStart();
mMap.setCallbackUnsupported(this::reportUnsupported);
mMap.setMapRenderingListener(this);
mMap.updateMyPositionRoutingOffset(0);
UiThread.runLater(() -> mMap.updateMyPositionRoutingOffset(0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this one only?
I suppose that mMap.updateMyPositionRoutingOffset call is semantically the same as mMap.setMapRenderingListener, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this code is run in the UI thread anyway but I want to schedule this function call for a later not overcross with the same call from the device which may break the offset for AA. But I covered the device's call with if (isDeviceDisplayUsed). So, it shouldn't be a problem but to be 100% sure

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an explaining comment into the code, it looks unclear.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these UiThread.runLater() look like a magic, but I understand this issue. Please add a comment and we can merge this PR.

Copy link
Contributor

@rtsisyk rtsisyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please add a comment.

@rtsisyk rtsisyk self-assigned this Mar 28, 2024
Copy link
Member

@Jean-BaptisteC Jean-BaptisteC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Pixel 6 - Android 14 + AA Emulator

@rtsisyk rtsisyk merged commit 111a680 into organicmaps:master Apr 4, 2024
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AndroidAuto Android Auto
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android Auto focus point for car icon is sometimes off and at the top of the screen instead of the bottom
5 participants