diff --git a/android/src/com/mapswithme/maps/MwmApplication.java b/android/src/com/mapswithme/maps/MwmApplication.java index 3af087bf9a..4e2d1de3ef 100644 --- a/android/src/com/mapswithme/maps/MwmApplication.java +++ b/android/src/com/mapswithme/maps/MwmApplication.java @@ -329,7 +329,7 @@ public class MwmApplication extends Application implements AppBackgroundTracker. { HashMap paramsMap = new HashMap<>(); for (KeyValue p : params) - paramsMap.put(p.mKey, p.mValue); + paramsMap.put(p.getKey(), p.getValue()); AppsFlyerLib.getInstance().trackEvent(this, tag, paramsMap); } diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarksCatalogFragment.java b/android/src/com/mapswithme/maps/bookmarks/BookmarksCatalogFragment.java index d3ee84e8e3..ae9c47074b 100644 --- a/android/src/com/mapswithme/maps/bookmarks/BookmarksCatalogFragment.java +++ b/android/src/com/mapswithme/maps/bookmarks/BookmarksCatalogFragment.java @@ -303,8 +303,8 @@ public class BookmarksCatalogFragment extends BaseWebViewMwmFragment for (KeyValue header : BookmarkManager.INSTANCE.getCatalogHeaders()) { - if (!TextUtils.isEmpty(header.mValue)) - headers.put(header.mKey, header.mValue); + if (!TextUtils.isEmpty(header.getValue())) + headers.put(header.getKey(), header.getValue()); } mWebView.loadUrl(getCatalogUrlOrThrow(), headers); diff --git a/android/src/com/mapswithme/util/HttpClient.java b/android/src/com/mapswithme/util/HttpClient.java index 9302285db4..7960c786a0 100644 --- a/android/src/com/mapswithme/util/HttpClient.java +++ b/android/src/com/mapswithme/util/HttpClient.java @@ -25,9 +25,9 @@ package com.mapswithme.util; import android.os.Build; -import androidx.annotation.NonNull; import android.text.TextUtils; +import androidx.annotation.NonNull; import com.mapswithme.util.log.Logger; import com.mapswithme.util.log.LoggerFactory; @@ -57,7 +57,6 @@ public final class HttpClient public static final String HEADER_AUTHORIZATION = "Authorization"; public static final String HEADER_BEARER_PREFFIX = "Bearer "; public static final String HEADER_BUNDLE_TIERS = "X-Mapsme-Bundle-Tiers"; - public static final String HEADER_DEVICE_ID = "X-Mapsme-Device-Id"; private final static String TAG = HttpClient.class.getSimpleName(); // TODO(AlexZ): tune for larger files private final static int STREAM_BUFFER_SIZE = 1024 * 64; @@ -104,7 +103,7 @@ public final class HttpClient for (KeyValue header : p.headers) { - connection.setRequestProperty(header.mKey, header.mValue); + connection.setRequestProperty(header.getKey(), header.getValue()); } if (!TextUtils.isEmpty(p.inputFilePath) || p.data != null) diff --git a/android/src/com/mapswithme/util/HttpUploader.java b/android/src/com/mapswithme/util/HttpUploader.java index ba258e54f8..5878e88783 100644 --- a/android/src/com/mapswithme/util/HttpUploader.java +++ b/android/src/com/mapswithme/util/HttpUploader.java @@ -3,12 +3,16 @@ package com.mapswithme.util; import android.os.Build; import android.text.TextUtils; import android.util.Base64; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.mapswithme.maps.BuildConfig; import com.mapswithme.maps.Framework; import com.mapswithme.util.log.Logger; import com.mapswithme.util.log.LoggerFactory; + +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSocketFactory; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; @@ -22,8 +26,6 @@ import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.util.List; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLSocketFactory; public final class HttpUploader extends AbstractHttpUploader { @@ -184,13 +186,13 @@ public final class HttpUploader extends AbstractHttpUploader headers.add(new KeyValue("Content-Type", "multipart/form-data; boundary=" + mBoundary)); headers.add(new KeyValue("Content-Length", String.valueOf(bodyLength))); for (KeyValue header : headers) - connection.setRequestProperty(header.mKey, header.mValue); + connection.setRequestProperty(header.getKey(), header.getValue()); } private void fillBodyParams(@NonNull StringBuilder builder) { for (KeyValue field : getPayload().getParams()) - addParam(builder, field.mKey, field.mValue); + addParam(builder, field.getKey(), field.getValue()); } private void addParam(@NonNull StringBuilder builder, @NonNull String key, @NonNull String value) diff --git a/android/src/com/mapswithme/util/KeyValue.java b/android/src/com/mapswithme/util/KeyValue.java index 1f891dfc68..58ed393d1a 100644 --- a/android/src/com/mapswithme/util/KeyValue.java +++ b/android/src/com/mapswithme/util/KeyValue.java @@ -5,16 +5,28 @@ import com.google.gson.annotations.SerializedName; public final class KeyValue { + @NonNull + @SerializedName("key") + private final String mKey; + @NonNull + @SerializedName("value") + private final String mValue; + public KeyValue(@NonNull String key, @NonNull String value) { mKey = key; mValue = value; } - @SerializedName("key") @NonNull - public final String mKey; - @SerializedName("value") + public String getKey() + { + return mKey; + } + @NonNull - public final String mValue; + public String getValue() + { + return mValue; + } }