diff --git a/OsmAnd/AndroidManifest.xml b/OsmAnd/AndroidManifest.xml
index 5cc90e170d..7ca98ddfc8 100644
--- a/OsmAnd/AndroidManifest.xml
+++ b/OsmAnd/AndroidManifest.xml
@@ -1026,6 +1026,7 @@
+
diff --git a/OsmAnd/res/layout/test_backup_layout.xml b/OsmAnd/res/layout/test_backup_layout.xml
new file mode 100644
index 0000000000..216820a9bf
--- /dev/null
+++ b/OsmAnd/res/layout/test_backup_layout.xml
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml
index 4cb0bab704..307f2513cc 100644
--- a/OsmAnd/res/values-ar/strings.xml
+++ b/OsmAnd/res/values-ar/strings.xml
@@ -4154,5 +4154,4 @@
الإعلان عند التجاوز
نقاط المستخدم
الإخراج
- %1$s ← …
\ No newline at end of file
diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml
index 094ba47620..dae511a7f4 100644
--- a/OsmAnd/res/values-de/strings.xml
+++ b/OsmAnd/res/values-de/strings.xml
@@ -4089,5 +4089,4 @@
Meldung bei Überschreitung
Anwenderpunkte
Leistung
- %1$s → …
\ No newline at end of file
diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml
index 5b9d9345b5..19328a93e7 100644
--- a/OsmAnd/res/values-eo/strings.xml
+++ b/OsmAnd/res/values-eo/strings.xml
@@ -4085,5 +4085,4 @@
Numero de elirejo
Poentoj de uzanto
Eligo
- %1$s → …
\ No newline at end of file
diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml
index bcf6918377..c7a7007a59 100644
--- a/OsmAnd/res/values-es-rAR/strings.xml
+++ b/OsmAnd/res/values-es-rAR/strings.xml
@@ -4087,5 +4087,4 @@
Anunciar al excederse
Puntos de usuario
Salida
- %1$s → …
\ No newline at end of file
diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml
index b45c597a1a..8fa7588019 100644
--- a/OsmAnd/res/values-fr/strings.xml
+++ b/OsmAnd/res/values-fr/strings.xml
@@ -4075,5 +4075,4 @@
Numéro de sortie
Annoncer en cas de dépassement
Sortie
- %1$s → …
\ No newline at end of file
diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml
index 9709e8bce8..ced108288e 100644
--- a/OsmAnd/res/values-hu/strings.xml
+++ b/OsmAnd/res/values-hu/strings.xml
@@ -4074,7 +4074,6 @@
Várakoztatva
Lejárt
Frissüljön minden térkép, amely hozzá lett adva ehhez: %1$s\?
- %1$s → …
Kijárat száma
Értesítés túllépéskor
Felhasználói pontok
diff --git a/OsmAnd/res/values-iw/strings.xml b/OsmAnd/res/values-iw/strings.xml
index e7684a1670..8fee045082 100644
--- a/OsmAnd/res/values-iw/strings.xml
+++ b/OsmAnd/res/values-iw/strings.xml
@@ -4087,5 +4087,4 @@
להכריז בחריגה
נקודות משתמש
פלט
- %1$s ← …
\ No newline at end of file
diff --git a/OsmAnd/res/values-pt/strings.xml b/OsmAnd/res/values-pt/strings.xml
index d805e31c37..8d3a99bb75 100644
--- a/OsmAnd/res/values-pt/strings.xml
+++ b/OsmAnd/res/values-pt/strings.xml
@@ -4089,5 +4089,4 @@
Anunciar quando ultrapassado
Pontos do utilizador
Saída
- %1$s → …
\ No newline at end of file
diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml
index 3ad683a6fb..4fe37da2e3 100644
--- a/OsmAnd/res/values-uk/strings.xml
+++ b/OsmAnd/res/values-uk/strings.xml
@@ -4084,5 +4084,4 @@
Повідомляти про перевищення
Користувацькі точки
Вивід
- %1$s → …
\ No newline at end of file
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 97cfcf3a42..9959488bd2 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -12,7 +12,6 @@
-->
- %1$s → …
Output
User points
Announce when exceeded
diff --git a/OsmAnd/res/xml/development_settings.xml b/OsmAnd/res/xml/development_settings.xml
index 231bd469bc..75079dd7ed 100644
--- a/OsmAnd/res/xml/development_settings.xml
+++ b/OsmAnd/res/xml/development_settings.xml
@@ -70,6 +70,13 @@
android:summary="@string/play_commands_of_currently_selected_voice"
android:title="@string/test_voice_prompts" />
+
+
getAdditionalParams(@NonNull File file);
+ void onFileUploadProgress(@NonNull File file, int percent);
+ void onFilesUploadDone(@NonNull Map errors);
+ }
+
public static class RequestResponse {
private Request request;
private String response;
@@ -156,7 +166,7 @@ public class AndroidNetworkUtils {
String params = null;
if (parameters != null && parameters.size() > 0) {
StringBuilder sb = new StringBuilder();
- for (Map.Entry entry : parameters.entrySet()) {
+ for (Entry entry : parameters.entrySet()) {
if (sb.length() > 0) {
sb.append("&");
}
@@ -296,16 +306,18 @@ public class AndroidNetworkUtils {
private static final String BOUNDARY = "CowMooCowMooCowCowCow";
- public static String uploadFile(String urlText, File file, boolean gzip, Map additionalParams) throws IOException {
- return uploadFile(urlText, new FileInputStream(file), file.getName(), gzip, additionalParams);
+ public static String uploadFile(@NonNull String urlText, @NonNull File file, boolean gzip,
+ @NonNull Map additionalParams, @Nullable Map headers) throws IOException {
+ return uploadFile(urlText, new FileInputStream(file), file.getName(), gzip, additionalParams, headers);
}
- public static String uploadFile(String urlText, InputStream inputStream, String fileName, boolean gzip, Map additionalParams) {
+ public static String uploadFile(@NonNull String urlText, @NonNull InputStream inputStream, @NonNull String fileName, boolean gzip,
+ Map additionalParams, @Nullable Map headers) {
URL url;
try {
boolean firstPrm = !urlText.contains("?");
StringBuilder sb = new StringBuilder(urlText);
- for (Map.Entry entry : additionalParams.entrySet()) {
+ for (Entry entry : additionalParams.entrySet()) {
sb.append(firstPrm ? "?" : "&").append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue(), "UTF-8"));
firstPrm = false;
}
@@ -320,6 +332,11 @@ public class AndroidNetworkUtils {
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
conn.setRequestProperty("User-Agent", "OsmAnd");
+ if (headers != null) {
+ for (Entry header : headers.entrySet()) {
+ conn.setRequestProperty(header.getKey(), header.getValue());
+ }
+ }
OutputStream ous = conn.getOutputStream();
ous.write(("--" + BOUNDARY + "\r\n").getBytes());
@@ -376,6 +393,58 @@ public class AndroidNetworkUtils {
}
}
+ public static void uploadFilesAsync(final @NonNull String url,
+ final @NonNull List files,
+ final boolean gzip,
+ final @NonNull Map parameters,
+ final @Nullable Map headers,
+ final OnFilesUploadCallback callback) {
+
+ new AsyncTask>() {
+
+ @Override
+ @NonNull
+ protected Map doInBackground(Void... v) {
+ Map errors = new HashMap<>();
+ for (File file : files) {
+ publishProgress(file, 0);
+ try {
+ Map params = new HashMap<>(parameters);
+ if (callback != null) {
+ Map additionalParams = callback.getAdditionalParams(file);
+ if (additionalParams != null) {
+ params.putAll(additionalParams);
+ }
+ }
+ String res = uploadFile(url, file, gzip, params, headers);
+ if (res != null) {
+ errors.put(file, res);
+ }
+ } catch (Exception e) {
+ errors.put(file, e.getMessage());
+ }
+ publishProgress(file, 100);
+ }
+ return errors;
+ }
+
+ @Override
+ protected void onProgressUpdate(Object... objects) {
+ if (callback != null) {
+ callback.onFileUploadProgress((File) objects[0], (Integer) objects[1]);
+ }
+ }
+
+ @Override
+ protected void onPostExecute(@NonNull Map errors) {
+ if (callback != null) {
+ callback.onFilesUploadDone(errors);
+ }
+ }
+
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
+ }
+
private static void showToast(OsmandApplication ctx, String message) {
ctx.showToastMessage(message);
}
diff --git a/OsmAnd/src/net/osmand/plus/AnalyticsHelper.java b/OsmAnd/src/net/osmand/plus/AnalyticsHelper.java
index 2fd12a11ac..e8d04254c3 100644
--- a/OsmAnd/src/net/osmand/plus/AnalyticsHelper.java
+++ b/OsmAnd/src/net/osmand/plus/AnalyticsHelper.java
@@ -184,7 +184,7 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
String jsonStr = json.toString();
InputStream inputStream = new ByteArrayInputStream(jsonStr.getBytes());
- String res = AndroidNetworkUtils.uploadFile(ANALYTICS_UPLOAD_URL, inputStream, ANALYTICS_FILE_NAME, true, additionalData);
+ String res = AndroidNetworkUtils.uploadFile(ANALYTICS_UPLOAD_URL, inputStream, ANALYTICS_FILE_NAME, true, additionalData, null);
if (res != null) {
return;
}
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioNotesLayer.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioNotesLayer.java
index 96ce49d8db..727e7d683b 100644
--- a/OsmAnd/src/net/osmand/plus/audionotes/AudioNotesLayer.java
+++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioNotesLayer.java
@@ -169,6 +169,11 @@ public class AudioNotesLayer extends OsmandMapLayer implements
return false;
}
+ @Override
+ public boolean showMenuAction(@Nullable Object o) {
+ return false;
+ }
+
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List