Skip to content

Commit

Permalink
Merge branch 'r4.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
Chumva committed Nov 20, 2024
2 parents 8eb1e61 + 30c9ac0 commit 6f38bdb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions OsmAnd/src/net/osmand/plus/AppInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import net.osmand.plus.helpers.*;
import net.osmand.plus.importfiles.ImportHelper;
import net.osmand.plus.inapp.InAppPurchaseHelperImpl;
import net.osmand.plus.inapp.InAppPurchaseUtils;
import net.osmand.plus.keyevent.InputDevicesHelper;
import net.osmand.plus.keyevent.KeyEventHelper;
import net.osmand.plus.mapmarkers.MapMarkersDbHelper;
Expand Down Expand Up @@ -535,10 +536,9 @@ private void startApplicationBackground() {
}
}
}

private void checkLiveUpdatesAlerts() {
OsmandSettings settings = app.getSettings();
if (settings.IS_LIVE_UPDATES_ON.get()) {
if (InAppPurchaseUtils.isLiveUpdatesAvailable(app) && settings.IS_LIVE_UPDATES_ON.get()) {
LocalIndexHelper helper = new LocalIndexHelper(app);
AlarmManager manager = (AlarmManager) app.getSystemService(Context.ALARM_SERVICE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ protected void createToolbar(@NonNull ViewGroup appBar) {
container.addView(button);

toolbarSwitchContainer = appBarLayout.findViewById(R.id.toolbar_switch_container);
updateToolbarSwitch(settings.IS_LIVE_UPDATES_ON.get());
updateToolbarSwitch(InAppPurchaseUtils.isLiveUpdatesAvailable(app) && settings.IS_LIVE_UPDATES_ON.get());
}

private void updateToolbarSwitch(boolean isChecked) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
import net.osmand.plus.download.DownloadActivityType;
import net.osmand.plus.download.DownloadIndexesThread;
import net.osmand.plus.download.IndexItem;
import net.osmand.plus.download.SrtmDownloadItem;
import net.osmand.plus.download.local.LocalIndexHelper;
import net.osmand.plus.download.local.LocalItemType;
import net.osmand.plus.download.local.LocalItem;
import net.osmand.plus.download.SrtmDownloadItem;
import net.osmand.plus.download.local.LocalItemType;
import net.osmand.plus.helpers.FileNameTranslationHelper;
import net.osmand.plus.inapp.InAppPurchaseUtils;
import net.osmand.plus.liveupdates.LiveUpdatesHelper;
Expand Down Expand Up @@ -201,12 +201,12 @@ public void buttonPressed() {
}

private boolean isLiveUpdatesOn() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
return mapActivity.getMyApplication().getSettings().IS_LIVE_UPDATES_ON.get();
} else {
return false;
MapActivity activity = getMapActivity();
if (activity != null) {
OsmandApplication app = activity.getMyApplication();
return InAppPurchaseUtils.isLiveUpdatesAvailable(app) && app.getSettings().IS_LIVE_UPDATES_ON.get();
}
return false;
}

@Override
Expand Down Expand Up @@ -660,7 +660,7 @@ private File getFileToRestore(@NonNull LocalItem item) {
} else if (item.getType() == LocalItemType.ROAD_DATA) {
parent = app.getAppPath(IndexConstants.ROADS_INDEX_DIR);
} else if (item.getType() == LocalItemType.TILES_DATA) {
if (fileName.endsWith(IndexConstants.TIF_EXT)) {
if (fileName.endsWith(IndexConstants.TIF_EXT)) {
parent = app.getAppPath(IndexConstants.GEOTIFF_DIR);
} else {
parent = app.getAppPath(IndexConstants.TILES_INDEX_DIR);
Expand Down

0 comments on commit 6f38bdb

Please sign in to comment.