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

Fix aa zoom new #21351

Open
wants to merge 3 commits into
base: r4.9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions OsmAnd/src/net/osmand/plus/auto/NavigationSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ public void onNewIntent(@NonNull Intent intent) {
}

private void processNavigationIntent(@NonNull Uri uri) {
Log.d(TAG, "processNavigationIntent: ");
GeoParsedPoint point = GeoPointParserUtil.parse(uri.toString());
if (point != null) {
CarContext context = getCarContext();
Expand Down Expand Up @@ -378,7 +379,8 @@ private void processNavigationIntent(@NonNull Uri uri) {
});
} else {
String text = point.isGeoAddress() ? point.getQuery() : uri.toString();
screenManager.pushForResult(new SearchResultsScreen(context, settingsAction, text), (obj) -> {});
screenManager.pushForResult(new SearchResultsScreen(context, settingsAction, text), (obj) -> {
});
}
}
}
Expand Down Expand Up @@ -415,7 +417,10 @@ public boolean requestLocationNavigation() {
}

public void startNavigation() {
createNavigationScreen();
if (navigationScreen == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Already redundant

createNavigationScreen();
}
Log.d(TAG, "startNavigation: NavigationSession");
getCarContext().getCarService(ScreenManager.class).push(navigationScreen);
}

Expand Down Expand Up @@ -497,10 +502,11 @@ private void showRoutePreview() {
screenManager.popToRoot();
screenManager.pushForResult(new RoutePreviewScreen(context, settingsAction, result, false), (obj) -> {
if (obj != null) {
app.getOsmandMap().getMapLayers().getMapActionsHelper().startNavigation();
Log.d(TAG, "Nav Session openPreview result: ");
if (hasStarted()) {
startNavigation();
}
app.getOsmandMap().getMapLayers().getMapActionsHelper().startNavigation();
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't looks right

}
});
}
Expand Down Expand Up @@ -624,6 +630,7 @@ public void clearCarContext() {
* Starts navigation.
*/
public void startCarNavigation() {
Log.d(TAG, "startCarNavigation: ");
if (navigationManager != null) {
navigationManager.navigationStarted();
carNavigationActive = true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package net.osmand.plus.auto.screens

import android.graphics.Rect
import android.util.Log
import androidx.car.app.CarContext
import androidx.car.app.Screen
import androidx.car.app.constraints.ConstraintManager
Expand Down Expand Up @@ -61,9 +59,9 @@ abstract class BaseAndroidAutoScreen(carContext: CarContext) : Screen(carContext
}

private fun startNavigation() {
app.osmandMap.mapLayers.mapActionsHelper.startNavigation()
val session = app.carNavigationSession
session?.startNavigation()
app.osmandMap.mapLayers.mapActionsHelper.startNavigation()
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't looks right

}

protected fun createSearchAction() = Action.Builder()
Expand Down
Loading