Skip to content

Commit

Permalink
change:android:Remove map download size limit on modern Android versi…
Browse files Browse the repository at this point in the history
…ons (#1029)

* Android: Increase map download size limit

* Condition

* Condition #2

* ru

* Condition #3

* Clean up

* Try...

* String

* long->double

* Incorrect version

* Fix comment indent

* 4GiB to 3.8GiB as before

* Simplify expression

* Int

* Make Android version regex more save

* Fix

* Don't crash on strings containing no numeric value

* Revert strings

* Revert string

* Simplify

* Add space and comment

* Skip variable

* CheckStyle

* Simplify

Co-authored-by: jkoan <jkoan@users.noreply.github.com>
  • Loading branch information
jfitie and jkoan committed Aug 9, 2020
1 parent a829597 commit 5e1377c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Message;
import android.support.v4.app.ActivityCompat;
Expand Down Expand Up @@ -197,7 +198,9 @@ public boolean onChildClick(ExpandableListView parent, View v, int groupPosition
String mapIndex = child.get("map_index");
if (mapIndex != null) {
int mi = Integer.parseInt(mapIndex);
if (NavitMapDownloader.osm_maps[mi].mEstSizeBytes / 1024 / 1024 / 950 >= 4) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N
&& NavitMapDownloader.osm_maps[mi].mEstSizeBytes >= Math.pow(2, 32) * 0.95) {
// limit map download size to 3.8GiB on Android versions before Nougat
NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST_LONG, null,
getTstring(R.string.map_download_oversize),
-1, 0, 0);
Expand Down

0 comments on commit 5e1377c

Please sign in to comment.