[android-auto] Fix maps downloading in planning mode

Signed-off-by: Andrew Shkrob <andrew.shkrob.social@yandex.by>
This commit is contained in:
Andrew Shkrob 2024-12-27 23:32:47 +01:00 committed by Roman Tsisyk
parent 0c28dcbabd
commit 7de8fdd3bb
2 changed files with 9 additions and 4 deletions

View file

@ -22,6 +22,7 @@ import app.organicmaps.car.screens.MapScreen;
import app.organicmaps.car.screens.PlaceScreen;
import app.organicmaps.car.screens.RequestPermissionsScreen;
import app.organicmaps.car.screens.base.BaseMapScreen;
import app.organicmaps.car.screens.download.DownloadMapsScreen;
import app.organicmaps.car.screens.download.DownloadMapsScreenBuilder;
import app.organicmaps.car.screens.download.DownloaderHelpers;
import app.organicmaps.car.util.CarSensorsManager;
@ -239,6 +240,10 @@ public final class CarAppSession extends Session implements DefaultLifecycleObse
@Override
public void onPlacePageActivated(@NonNull PlacePageData data)
{
// TODO: How maps downloading can trigger place page activation?
if (DownloadMapsScreen.MARKER.equals(mScreenManager.getTop().getMarker()))
return;
final MapObject mapObject = (MapObject) data;
// Don't display the PlaceScreen for 'MY_POSITION' or during navigation
// TODO (AndrewShkrob): Implement the 'Add stop' functionality

View file

@ -162,8 +162,8 @@ class DownloaderScreen extends BaseScreen
{
long downloadedSize = 0;
for (final var item : mMissingMaps.entrySet())
downloadedSize += item.getValue().downloadedBytes;
for (final CountryItem map : mMissingMaps.values())
downloadedSize += map.downloadedBytes;
return downloadedSize + mDownloadedMapsSize;
}
@ -182,7 +182,7 @@ class DownloaderScreen extends BaseScreen
private void cancelMapsDownloading()
{
for (final var map : mMissingMaps.entrySet())
MapManager.nativeCancel(map.getKey());
for (final String map : mMissingMaps.keySet())
MapManager.nativeCancel(map);
}
}