Merge branch 'organicmaps:master' into public-transit
This commit is contained in:
commit
04832554d9
352 changed files with 51239 additions and 44283 deletions
28
.github/workflows/android-check.yaml
vendored
28
.github/workflows/android-check.yaml
vendored
|
@ -28,6 +28,11 @@ jobs:
|
|||
android-check:
|
||||
name: Build Android Debug
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [WebDebug, FdroidBeta]
|
||||
|
||||
steps:
|
||||
- name: Install build tools and dependencies
|
||||
shell: bash
|
||||
|
@ -35,15 +40,10 @@ jobs:
|
|||
sudo apt-get update -y
|
||||
sudo apt-get install -y ninja-build
|
||||
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 100 # enough to get all commits for the current day
|
||||
fetch-depth: 200 # enough to get all commits for the current day
|
||||
|
||||
- name: Parallel submodules checkout
|
||||
shell: bash
|
||||
|
@ -53,21 +53,17 @@ jobs:
|
|||
shell: bash
|
||||
run: ./configure.sh
|
||||
|
||||
- name: Set up SDK
|
||||
shell: bash
|
||||
run: (cd tools/android; ./set_up_android.py --sdk $ANDROID_SDK_ROOT)
|
||||
|
||||
- name: Compile
|
||||
- name: Compile ${{ matrix.flavor }}
|
||||
shell: bash
|
||||
working-directory: android
|
||||
run: |
|
||||
cmake --version
|
||||
ninja --version
|
||||
gradle -Parm64 assembleWebDebug
|
||||
gradle -Parm64 assemble${{ matrix.flavor }}
|
||||
|
||||
- name: Upload arm64-v8a debug apk
|
||||
uses: actions/upload-artifact@v2
|
||||
- name: Upload arm64-v8a ${{ matrix.flavor }} apk
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: android-web-arm64-v8a-debug
|
||||
path: android/build/outputs/apk/web/debug/OrganicMaps-*-web-debug.apk
|
||||
name: android-arm64-v8a-${{ matrix.flavor }}
|
||||
path: android/build/outputs/apk/**/OrganicMaps-*.apk
|
||||
if-no-files-found: error
|
||||
|
|
4
.github/workflows/linux-check.yaml
vendored
4
.github/workflows/linux-check.yaml
vendored
|
@ -108,8 +108,8 @@ jobs:
|
|||
CXX: ${{ matrix.compiler.CXX }}
|
||||
# -g1 should slightly reduce build time.
|
||||
run: |
|
||||
echo "Building ${{ matrix.params.CMAKE_BUILD_TYPE }}"
|
||||
cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} -DCMAKE_CXX_FLAGS=-g1
|
||||
echo "Building ${{ matrix.CMAKE_BUILD_TYPE }}"
|
||||
cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} -DCMAKE_C_FLAGS=-g1 -DCMAKE_CXX_FLAGS=-g1
|
||||
|
||||
- name: Compile
|
||||
shell: bash
|
||||
|
|
|
@ -21,9 +21,7 @@ omim_add_library(${PROJECT_NAME} ${SRC})
|
|||
|
||||
target_include_directories(${PROJECT_NAME} INTERFACE .)
|
||||
|
||||
if (NOT PLATFORM_ANDROID)
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-deprecated-copy)
|
||||
endif()
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-deprecated-copy)
|
||||
|
||||
omim_add_test_subdirectory(opening_hours_tests)
|
||||
omim_add_test_subdirectory(opening_hours_integration_tests)
|
||||
|
|
|
@ -26,6 +26,7 @@ buildscript {
|
|||
ext.googleFirebaseServicesEnabled = project.hasProperty('firebase') ?: googleFirebaseServicesDefault
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools:r8:3.3.28'
|
||||
classpath 'com.android.tools.build:gradle:7.2.1'
|
||||
|
||||
if (googleMobileServicesEnabled) {
|
||||
|
@ -79,14 +80,12 @@ dependencies {
|
|||
}
|
||||
|
||||
implementation 'androidx.annotation:annotation:1.3.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.4.2'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.fragment:fragment:1.4.1'
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
implementation 'androidx.preference:preference:1.2.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||
implementation 'androidx.work:work-runtime:2.7.1'
|
||||
implementation 'com.github.bumptech.glide:glide:4.13.2'
|
||||
implementation 'com.google.android.material:material:1.7.0-alpha02'
|
||||
implementation 'com.google.code.gson:gson:2.9.0'
|
||||
implementation 'com.timehop.stickyheadersrecyclerview:library:0.4.3@aar'
|
||||
|
@ -136,7 +135,7 @@ android {
|
|||
compileSdkVersion propCompileSdkVersion.toInteger()
|
||||
buildToolsVersion propBuildToolsVersion
|
||||
|
||||
ndkVersion '23.1.7779620'
|
||||
ndkVersion '24.0.8215888'
|
||||
|
||||
defaultConfig {
|
||||
// Default package name is taken from the manifest and should be app.organicmaps
|
||||
|
@ -315,7 +314,8 @@ android {
|
|||
signingConfig signingConfigs.debug
|
||||
resValue 'string', 'app_id', android.defaultConfig.applicationId + applicationIdSuffix
|
||||
resValue 'string', 'app_name', project.ext.appName + ' ' + '(Debug)'
|
||||
ndk.debugSymbolLevel = 'SYMBOL_TABLE'
|
||||
// Do not generate separate debug symbols for debug apps, because we don't distribute them.
|
||||
ndk.debugSymbolLevel = 'none'
|
||||
|
||||
if (googleFirebaseServicesEnabled) {
|
||||
firebaseCrashlytics {
|
||||
|
@ -328,12 +328,14 @@ android {
|
|||
signingConfig signingConfigs.release
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
proguardFile('proguard-mwm.txt')
|
||||
// Includes the default ProGuard rules files that are packaged with the Android Gradle plugin.
|
||||
// To learn more, go to the documentation section about R8 configuration files.
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-mwm.txt'
|
||||
resValue 'string', 'app_id', android.defaultConfig.applicationId
|
||||
resValue 'string', 'app_name', project.ext.appName
|
||||
ndk {
|
||||
debugSymbolLevel 'SYMBOL_TABLE'
|
||||
}
|
||||
// Full size symbols are too big for Google, 217mb aab vs 95mb.
|
||||
ndk.debugSymbolLevel = 'symbol_table'
|
||||
|
||||
if (googleFirebaseServicesEnabled) {
|
||||
firebaseCrashlytics {
|
||||
nativeSymbolUploadEnabled true
|
||||
|
@ -345,12 +347,17 @@ android {
|
|||
applicationIdSuffix '.beta'
|
||||
versionNameSuffix '-beta'
|
||||
signingConfig signingConfigs.release
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
// Includes the default ProGuard rules files that are packaged with the Android Gradle plugin.
|
||||
// To learn more, go to the documentation section about R8 configuration files.
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-mwm.txt'
|
||||
matchingFallbacks = ['debug', 'release']
|
||||
resValue 'string', 'app_id', android.defaultConfig.applicationId + applicationIdSuffix
|
||||
resValue 'string', 'app_name', project.ext.appName + ' ' + '(Beta)'
|
||||
ndk {
|
||||
debugSymbolLevel 'SYMBOL_TABLE'
|
||||
}
|
||||
// Full size symbols are too big for Google, 217mb aab vs 95mb.
|
||||
ndk.debugSymbolLevel = 'symbol_table'
|
||||
|
||||
if (googleFirebaseServicesEnabled) {
|
||||
firebaseCrashlytics {
|
||||
nativeSymbolUploadEnabled true
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
|||
import com.mapswithme.maps.MwmApplication;
|
||||
import com.mapswithme.maps.base.Initializable;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
@ -19,8 +18,7 @@ public enum CrashlyticsUtils implements Initializable<Context>
|
|||
@SuppressWarnings("NotNullFieldNotInitialized")
|
||||
@NonNull
|
||||
private Context mContext;
|
||||
private final static String TAG = CrashlyticsUtils.class.getSimpleName();
|
||||
private final static Logger mLogger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.THIRD_PARTY);
|
||||
private static final String TAG = CrashlyticsUtils.class.getSimpleName();
|
||||
|
||||
public void logException(@NonNull Throwable exception)
|
||||
{
|
||||
|
@ -58,11 +56,11 @@ public enum CrashlyticsUtils implements Initializable<Context>
|
|||
{
|
||||
if (isEnabled)
|
||||
{
|
||||
mLogger.d(TAG, "Crashlytics enabled");
|
||||
Logger.d(TAG, "Crashlytics enabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
mLogger.d(TAG, "Crashlytics disabled");
|
||||
Logger.d(TAG, "Crashlytics disabled");
|
||||
}
|
||||
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(isEnabled);
|
||||
}
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
package com.mapswithme.maps.location;
|
||||
|
||||
import static com.mapswithme.maps.location.LocationHelper.ERROR_GPS_OFF;
|
||||
import static com.mapswithme.maps.location.LocationHelper.ERROR_NOT_SUPPORTED;
|
||||
|
||||
import android.content.Context;
|
||||
import android.location.Location;
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.android.gms.location.FusedLocationProviderClient;
|
||||
import com.google.android.gms.location.LocationAvailability;
|
||||
import com.google.android.gms.location.LocationCallback;
|
||||
|
@ -18,11 +14,13 @@ import com.google.android.gms.location.LocationResult;
|
|||
import com.google.android.gms.location.LocationServices;
|
||||
import com.google.android.gms.location.LocationSettingsRequest;
|
||||
import com.google.android.gms.location.SettingsClient;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
|
||||
import static com.mapswithme.maps.location.LocationHelper.ERROR_NOT_SUPPORTED;
|
||||
|
||||
class GoogleFusedLocationProvider extends BaseLocationProvider
|
||||
{
|
||||
private final static String TAG = GoogleFusedLocationProvider.class.getSimpleName();
|
||||
|
||||
private static final String TAG = GoogleFusedLocationProvider.class.getSimpleName();
|
||||
@NonNull
|
||||
private final FusedLocationProviderClient mFusedLocationClient;
|
||||
@NonNull
|
||||
|
@ -45,7 +43,7 @@ class GoogleFusedLocationProvider extends BaseLocationProvider
|
|||
public void onLocationAvailability(@NonNull LocationAvailability availability)
|
||||
{
|
||||
if (!availability.isLocationAvailable()) {
|
||||
LOGGER.w(TAG, "isLocationAvailable returned false");
|
||||
Logger.w(TAG, "isLocationAvailable returned false");
|
||||
//mListener.onLocationError(ERROR_GPS_OFF);
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +66,7 @@ class GoogleFusedLocationProvider extends BaseLocationProvider
|
|||
@Override
|
||||
public void start(long interval)
|
||||
{
|
||||
LOGGER.d(TAG, "start()");
|
||||
Logger.d(TAG, "start()");
|
||||
if (mActive)
|
||||
throw new IllegalStateException("Already subscribed");
|
||||
mActive = true;
|
||||
|
@ -79,8 +77,8 @@ class GoogleFusedLocationProvider extends BaseLocationProvider
|
|||
// Wait a few seconds for accurate locations initially, when accurate locations could not be computed on the device immediately.
|
||||
// https://github.com/organicmaps/organicmaps/issues/2149
|
||||
locationRequest.setWaitForAccurateLocation(true);
|
||||
LOGGER.d(TAG, "Request Google fused provider to provide locations at this interval = "
|
||||
+ interval + " ms");
|
||||
Logger.d(TAG, "Request Google fused provider to provide locations at this interval = "
|
||||
+ interval + " ms");
|
||||
locationRequest.setFastestInterval(interval / 2);
|
||||
|
||||
LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();
|
||||
|
@ -88,16 +86,16 @@ class GoogleFusedLocationProvider extends BaseLocationProvider
|
|||
final LocationSettingsRequest locationSettingsRequest = builder.build();
|
||||
|
||||
mSettingsClient.checkLocationSettings(locationSettingsRequest).addOnSuccessListener(locationSettingsResponse -> {
|
||||
LOGGER.d(TAG, "Service is available");
|
||||
Logger.d(TAG, "Service is available");
|
||||
mFusedLocationClient.requestLocationUpdates(locationRequest, mCallback, Looper.myLooper());
|
||||
}).addOnFailureListener(e -> {
|
||||
LOGGER.e(TAG, "Service is not available: " + e);
|
||||
Logger.e(TAG, "Service is not available: " + e);
|
||||
mListener.onLocationError(ERROR_NOT_SUPPORTED);
|
||||
});
|
||||
|
||||
// onLocationResult() may not always be called regularly, however the device location is known.
|
||||
mFusedLocationClient.getLastLocation().addOnSuccessListener(location -> {
|
||||
LOGGER.d(TAG, "onLastLocation, location = " + location);
|
||||
Logger.d(TAG, "onLastLocation, location = " + location);
|
||||
if (location == null)
|
||||
return;
|
||||
mListener.onLocationChanged(location);
|
||||
|
@ -107,7 +105,7 @@ class GoogleFusedLocationProvider extends BaseLocationProvider
|
|||
@Override
|
||||
protected void stop()
|
||||
{
|
||||
LOGGER.d(TAG, "stop()");
|
||||
Logger.d(TAG, "stop()");
|
||||
mFusedLocationClient.removeLocationUpdates(mCallback);
|
||||
mActive = false;
|
||||
}
|
||||
|
|
|
@ -3,17 +3,14 @@ package com.mapswithme.maps.location;
|
|||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
import com.mapswithme.util.Config;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
public class LocationProviderFactory
|
||||
{
|
||||
private final static String TAG = LocationProviderFactory.class.getSimpleName();
|
||||
private final static Logger mLogger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.LOCATION);
|
||||
private static final String TAG = LocationProviderFactory.class.getSimpleName();
|
||||
|
||||
public static boolean isGoogleLocationAvailable(@NonNull Context context)
|
||||
{
|
||||
|
@ -24,12 +21,12 @@ public class LocationProviderFactory
|
|||
{
|
||||
if (isGoogleLocationAvailable(context) && Config.useGoogleServices())
|
||||
{
|
||||
mLogger.d(TAG, "Use google provider.");
|
||||
Logger.d(TAG, "Use google provider.");
|
||||
return new GoogleFusedLocationProvider(context, listener);
|
||||
}
|
||||
else
|
||||
{
|
||||
mLogger.d(TAG, "Use native provider");
|
||||
Logger.d(TAG, "Use native provider");
|
||||
return new AndroidNativeProvider(context, listener);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ set(SRC
|
|||
com/mapswithme/util/HttpUploader.cpp
|
||||
com/mapswithme/util/HttpUploaderUtils.cpp
|
||||
com/mapswithme/util/Language.cpp
|
||||
com/mapswithme/util/LoggerFactory.cpp
|
||||
com/mapswithme/util/LogsManager.cpp
|
||||
com/mapswithme/util/NetworkPolicy.cpp
|
||||
com/mapswithme/util/StringUtils.cpp
|
||||
com/mapswithme/vulkan/android_vulkan_context_factory.cpp
|
||||
|
|
|
@ -21,7 +21,7 @@ jclass g_httpClientClazz;
|
|||
jclass g_httpParamsClazz;
|
||||
jclass g_platformSocketClazz;
|
||||
jclass g_utilsClazz;
|
||||
jclass g_loggerFactoryClazz;
|
||||
jclass g_loggerClazz;
|
||||
jclass g_keyValueClazz;
|
||||
jclass g_httpUploaderClazz;
|
||||
jclass g_httpPayloadClazz;
|
||||
|
@ -48,7 +48,7 @@ JNI_OnLoad(JavaVM * jvm, void *)
|
|||
g_httpParamsClazz = jni::GetGlobalClassRef(env, "com/mapswithme/util/HttpClient$Params");
|
||||
g_platformSocketClazz = jni::GetGlobalClassRef(env, "com/mapswithme/maps/location/PlatformSocket");
|
||||
g_utilsClazz = jni::GetGlobalClassRef(env, "com/mapswithme/util/Utils");
|
||||
g_loggerFactoryClazz = jni::GetGlobalClassRef(env, "com/mapswithme/util/log/LoggerFactory");
|
||||
g_loggerClazz = jni::GetGlobalClassRef(env, "com/mapswithme/util/log/Logger");
|
||||
g_keyValueClazz = jni::GetGlobalClassRef(env, "com/mapswithme/util/KeyValue");
|
||||
g_httpUploaderClazz = jni::GetGlobalClassRef(env, "com/mapswithme/util/HttpUploader");
|
||||
g_httpPayloadClazz = jni::GetGlobalClassRef(env, "com/mapswithme/util/HttpPayload");
|
||||
|
@ -74,7 +74,7 @@ JNI_OnUnload(JavaVM *, void *)
|
|||
env->DeleteGlobalRef(g_httpParamsClazz);
|
||||
env->DeleteGlobalRef(g_platformSocketClazz);
|
||||
env->DeleteGlobalRef(g_utilsClazz);
|
||||
env->DeleteGlobalRef(g_loggerFactoryClazz);
|
||||
env->DeleteGlobalRef(g_loggerClazz);
|
||||
env->DeleteGlobalRef(g_keyValueClazz);
|
||||
env->DeleteGlobalRef(g_httpUploaderClazz);
|
||||
env->DeleteGlobalRef(g_httpPayloadClazz);
|
||||
|
|
|
@ -22,7 +22,7 @@ extern jclass g_httpClientClazz;
|
|||
extern jclass g_httpParamsClazz;
|
||||
extern jclass g_platformSocketClazz;
|
||||
extern jclass g_utilsClazz;
|
||||
extern jclass g_loggerFactoryClazz;
|
||||
extern jclass g_loggerClazz;
|
||||
extern jclass g_keyValueClazz;
|
||||
extern jclass g_httpUploaderClazz;
|
||||
extern jclass g_httpPayloadClazz;
|
||||
|
|
|
@ -31,12 +31,12 @@ void AndroidMessage(LogLevel level, SrcPoint const & src, std::string const & s)
|
|||
}
|
||||
|
||||
ScopedEnv env(jni::GetJVM());
|
||||
static jmethodID const logCoreMsgMethod = jni::GetStaticMethodID(env.get(), g_loggerFactoryClazz,
|
||||
"logCoreMessage", "(ILjava/lang/String;)V");
|
||||
static jmethodID const logMethod = jni::GetStaticMethodID(env.get(), g_loggerClazz,
|
||||
"log", "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V");
|
||||
|
||||
std::string const out = DebugPrint(src) + " " + s;
|
||||
std::string const out = DebugPrint(src) + s;
|
||||
jni::TScopedLocalRef msg(env.get(), jni::ToJavaString(env.get(), out));
|
||||
env->CallStaticVoidMethod(g_loggerFactoryClazz, logCoreMsgMethod, pr, msg.get());
|
||||
env->CallStaticVoidMethod(g_loggerClazz, logMethod, pr, NULL, msg.get(), NULL);
|
||||
}
|
||||
|
||||
void AndroidLogMessage(LogLevel level, SrcPoint const & src, std::string const & s)
|
||||
|
@ -69,17 +69,3 @@ void ToggleDebugLogs(bool enabled)
|
|||
g_LogLevel = LINFO;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
void DbgPrintC(char const * format, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
va_start(argptr, format);
|
||||
|
||||
__android_log_vprint(ANDROID_LOG_INFO, "OMaps_Debug", format, argptr);
|
||||
|
||||
va_end(argptr);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -290,12 +290,13 @@ extern "C"
|
|||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_com_mapswithme_maps_search_SearchEngine_nativeRunSearch(
|
||||
JNIEnv * env, jclass clazz, jbyteArray bytes, jstring lang, jlong timestamp,
|
||||
jboolean hasPosition, jdouble lat, jdouble lon)
|
||||
JNIEnv * env, jclass clazz, jbyteArray bytes, jboolean isCategory,
|
||||
jstring lang, jlong timestamp, jboolean hasPosition, jdouble lat, jdouble lon)
|
||||
{
|
||||
search::EverywhereSearchParams params;
|
||||
params.m_query = jni::ToNativeString(env, bytes);
|
||||
params.m_inputLocale = jni::ToNativeString(env, lang);
|
||||
params.m_isCategory = isCategory;
|
||||
params.m_onResults = bind(&OnResults, _1, _2, timestamp, false, hasPosition, lat, lon);
|
||||
bool const searchStarted = g_framework->NativeFramework()->GetSearchAPI().SearchEverywhere(params);
|
||||
if (searchStarted)
|
||||
|
@ -304,12 +305,13 @@ extern "C"
|
|||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_mapswithme_maps_search_SearchEngine_nativeRunInteractiveSearch(
|
||||
JNIEnv * env, jclass clazz, jbyteArray bytes, jstring lang, jlong timestamp,
|
||||
jboolean isMapAndTable)
|
||||
JNIEnv * env, jclass clazz, jbyteArray bytes, jboolean isCategory,
|
||||
jstring lang, jlong timestamp, jboolean isMapAndTable)
|
||||
{
|
||||
search::ViewportSearchParams vparams;
|
||||
vparams.m_query = jni::ToNativeString(env, bytes);
|
||||
vparams.m_inputLocale = jni::ToNativeString(env, lang);
|
||||
vparams.m_isCategory = isCategory;
|
||||
|
||||
// TODO (@alexzatsepin): set up vparams.m_onCompleted here and use
|
||||
// HotelsClassifier for hotel queries detection.
|
||||
|
|
|
@ -298,20 +298,20 @@ extern "C"
|
|||
{
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeShowBookmarkOnMap(
|
||||
JNIEnv * env, jobject thiz, jlong bmkId)
|
||||
JNIEnv *, jobject, jlong bmkId)
|
||||
{
|
||||
frm()->ShowBookmark(static_cast<kml::MarkId>(bmkId));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeShowBookmarkCategoryOnMap(
|
||||
JNIEnv * env, jobject thiz, jlong catId)
|
||||
JNIEnv *, jobject, jlong catId)
|
||||
{
|
||||
frm()->ShowBookmarkCategory(static_cast<kml::MarkGroupId>(catId), true /* animated */);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeLoadBookmarks(JNIEnv * env, jobject)
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeLoadBookmarks(JNIEnv * env, jclass)
|
||||
{
|
||||
PrepareClassRefs(env);
|
||||
BookmarkManager::AsyncLoadingCallbacks callbacks;
|
||||
|
@ -326,35 +326,9 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeLoadBookmarks(JNIE
|
|||
frm()->LoadBookmarks();
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCategoriesCount(
|
||||
JNIEnv * env, jobject thiz)
|
||||
{
|
||||
return static_cast<int>(frm()->GetBookmarkManager().GetBmGroupsIdList().size());
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCategoryPositionById(
|
||||
JNIEnv * env, jobject thiz, jlong catId)
|
||||
{
|
||||
auto & ids = frm()->GetBookmarkManager().GetBmGroupsIdList();
|
||||
jint position = 0;
|
||||
while (position < ids.size() && ids[position] != catId)
|
||||
++position;
|
||||
return position;
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCategoryIdByPosition(
|
||||
JNIEnv * env, jobject thiz, jint position)
|
||||
{
|
||||
auto & ids = frm()->GetBookmarkManager().GetBmGroupsIdList();
|
||||
return static_cast<jlong>(position < ids.size() ? ids[position] : kml::kInvalidMarkGroupId);
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeCreateCategory(
|
||||
JNIEnv * env, jobject thiz, jstring name)
|
||||
JNIEnv * env, jobject, jstring name)
|
||||
{
|
||||
auto const categoryId = frm()->GetBookmarkManager().CreateBookmarkCategory(ToNativeString(env, name));
|
||||
frm()->GetBookmarkManager().SetLastEditedBmCategory(categoryId);
|
||||
|
@ -363,7 +337,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeCreateCategory(
|
|||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeDeleteCategory(
|
||||
JNIEnv * env, jobject thiz, jlong catId)
|
||||
JNIEnv *, jobject, jlong catId)
|
||||
{
|
||||
auto const categoryId = static_cast<kml::MarkGroupId>(catId);
|
||||
return static_cast<jboolean>(frm()->GetBookmarkManager().GetEditSession().DeleteBmCategory(categoryId));
|
||||
|
@ -377,14 +351,14 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeDeleteBookmark(JNI
|
|||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeDeleteTrack(
|
||||
JNIEnv * env, jobject thiz, jlong trkId)
|
||||
JNIEnv *, jobject, jlong trkId)
|
||||
{
|
||||
frm()->GetBookmarkManager().GetEditSession().DeleteTrack(static_cast<kml::TrackId>(trkId));
|
||||
}
|
||||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAddBookmarkToLastEditedCategory(
|
||||
JNIEnv * env, jobject thiz, double lat, double lon)
|
||||
JNIEnv * env, jobject, double lat, double lon)
|
||||
{
|
||||
if (!frm()->HasPlacePageInfo())
|
||||
return nullptr;
|
||||
|
@ -415,48 +389,48 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAddBookmarkToLastE
|
|||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetLastEditedCategory(
|
||||
JNIEnv * env, jobject thiz)
|
||||
JNIEnv *, jobject)
|
||||
{
|
||||
return static_cast<jlong>(frm()->LastEditedBMCategory());
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetLastEditedColor(
|
||||
JNIEnv * env, jobject thiz)
|
||||
JNIEnv *, jobject)
|
||||
{
|
||||
return static_cast<jint>(frm()->LastEditedBMColor());
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeLoadBookmarksFile(JNIEnv * env, jobject thiz,
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeLoadBookmarksFile(JNIEnv * env, jclass,
|
||||
jstring path, jboolean isTemporaryFile)
|
||||
{
|
||||
frm()->AddBookmarksFile(ToNativeString(env, path), isTemporaryFile);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeIsAsyncBookmarksLoadingInProgress(JNIEnv * env, jclass)
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeIsAsyncBookmarksLoadingInProgress(JNIEnv *, jclass)
|
||||
{
|
||||
return static_cast<jboolean>(frm()->GetBookmarkManager().IsAsyncLoadingInProgress());
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeIsVisible(
|
||||
JNIEnv * env, jobject thiz, jlong catId)
|
||||
JNIEnv *, jobject, jlong catId)
|
||||
{
|
||||
return static_cast<jboolean>(frm()->GetBookmarkManager().IsVisible(static_cast<kml::MarkGroupId>(catId)));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetVisibility(
|
||||
JNIEnv * env, jobject thiz, jlong catId, jboolean isVisible)
|
||||
JNIEnv *, jobject, jlong catId, jboolean isVisible)
|
||||
{
|
||||
frm()->GetBookmarkManager().GetEditSession().SetIsVisible(static_cast<kml::MarkGroupId>(catId), isVisible);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetCategoryName(
|
||||
JNIEnv * env, jobject thiz, jlong catId, jstring name)
|
||||
JNIEnv * env, jobject, jlong catId, jstring name)
|
||||
{
|
||||
frm()->GetBookmarkManager().GetEditSession().SetCategoryName(static_cast<kml::MarkGroupId>(catId),
|
||||
jni::ToNativeString(env, name));
|
||||
|
@ -464,7 +438,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetCategoryName(
|
|||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetCategoryDescription(JNIEnv * env,
|
||||
jobject thiz,
|
||||
jobject,
|
||||
jlong catId,
|
||||
jstring desc)
|
||||
{
|
||||
|
@ -491,7 +465,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetCategoryTags(
|
|||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetCategoryAccessRules(
|
||||
JNIEnv * env, jobject, jlong catId, jint accessRules)
|
||||
JNIEnv *, jobject, jlong catId, jint accessRules)
|
||||
{
|
||||
frm()->GetBookmarkManager().GetEditSession().SetCategoryAccessRules(
|
||||
static_cast<kml::MarkGroupId>(catId), static_cast<kml::AccessRules>(accessRules));
|
||||
|
@ -505,33 +479,9 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetCategoryCustomP
|
|||
static_cast<kml::MarkGroupId>(catId), ToNativeString(env, key), ToNativeString(env, value));
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetCategoryName(
|
||||
JNIEnv * env, jobject thiz, jlong catId)
|
||||
{
|
||||
return ToJavaString(env, frm()->GetBookmarkManager().GetCategoryName(
|
||||
static_cast<kml::MarkGroupId>(catId)));
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarksCount(
|
||||
JNIEnv * env, jobject thiz, jlong catId)
|
||||
{
|
||||
return static_cast<int>(frm()->GetBookmarkManager().GetUserMarkIds(
|
||||
static_cast<kml::MarkGroupId>(catId)).size());
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetTracksCount(
|
||||
JNIEnv * env, jobject thiz, jlong catId)
|
||||
{
|
||||
return static_cast<int>(frm()->GetBookmarkManager().GetTrackIds(
|
||||
static_cast<kml::MarkGroupId>(catId)).size());
|
||||
}
|
||||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeUpdateBookmarkPlacePage(
|
||||
JNIEnv * env, jobject thiz, jlong bmkId)
|
||||
JNIEnv * env, jobject, jlong bmkId)
|
||||
{
|
||||
if (!frm()->HasPlacePageInfo())
|
||||
return nullptr;
|
||||
|
@ -546,7 +496,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeUpdateBookmarkPlac
|
|||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkInfo(
|
||||
JNIEnv * env, jobject thiz, jlong bmkId)
|
||||
JNIEnv * env, jobject, jlong bmkId)
|
||||
{
|
||||
auto const bookmark = frm()->GetBookmarkManager().GetBookmark(static_cast<kml::MarkId>(bmkId));
|
||||
if (!bookmark)
|
||||
|
@ -558,10 +508,10 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkInfo(
|
|||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkIdByPosition(
|
||||
JNIEnv * env, jobject thiz, jlong catId, jint positionInCategory)
|
||||
JNIEnv *, jobject, jlong catId, jint positionInCategory)
|
||||
{
|
||||
auto & ids = frm()->GetBookmarkManager().GetUserMarkIds(static_cast<kml::MarkGroupId>(catId));
|
||||
if (positionInCategory >= ids.size())
|
||||
auto const & ids = frm()->GetBookmarkManager().GetUserMarkIds(static_cast<kml::MarkGroupId>(catId));
|
||||
if (positionInCategory >= static_cast<jlong>(ids.size()))
|
||||
return static_cast<jlong>(kml::kInvalidMarkId);
|
||||
auto it = ids.begin();
|
||||
std::advance(it, positionInCategory);
|
||||
|
@ -572,7 +522,7 @@ static uint32_t shift(uint32_t v, uint8_t bitCount) { return v << bitCount; }
|
|||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetTrack(
|
||||
JNIEnv * env, jobject thiz, jlong trackId, jclass trackClazz)
|
||||
JNIEnv * env, jobject, jlong trackId, jclass trackClazz)
|
||||
{
|
||||
// Track(long trackId, long categoryId, String name, String lengthString, int color)
|
||||
static jmethodID const cId = jni::GetConstructorID(env, trackClazz,
|
||||
|
@ -599,10 +549,10 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetTrack(
|
|||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetTrackIdByPosition(
|
||||
JNIEnv * env, jobject thiz, jlong catId, jint positionInCategory)
|
||||
JNIEnv *, jobject, jlong catId, jint positionInCategory)
|
||||
{
|
||||
auto & ids = frm()->GetBookmarkManager().GetTrackIds(static_cast<kml::MarkGroupId>(catId));
|
||||
if (positionInCategory >= ids.size())
|
||||
auto const & ids = frm()->GetBookmarkManager().GetTrackIds(static_cast<kml::MarkGroupId>(catId));
|
||||
if (positionInCategory >= static_cast<jlong>(ids.size()))
|
||||
return static_cast<jlong>(kml::kInvalidTrackId);
|
||||
auto it = ids.begin();
|
||||
std::advance(it, positionInCategory);
|
||||
|
@ -611,50 +561,49 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetTrackIdByPositi
|
|||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeIsUsedCategoryName(
|
||||
JNIEnv * env, jobject thiz, jstring name)
|
||||
JNIEnv * env, jclass, jstring name)
|
||||
{
|
||||
return static_cast<jboolean>(frm()->GetBookmarkManager().IsUsedCategoryName(
|
||||
ToNativeString(env, name)));
|
||||
return static_cast<jboolean>(frm()->GetBookmarkManager().IsUsedCategoryName(ToNativeString(env, name)));
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeIsSearchAllowed(
|
||||
JNIEnv * env, jobject thiz, jlong catId)
|
||||
JNIEnv *, jclass, jlong catId)
|
||||
{
|
||||
return static_cast<jboolean>(frm()->GetBookmarkManager().IsSearchAllowed(static_cast<kml::MarkGroupId>(catId)));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativePrepareForSearch(
|
||||
JNIEnv * env, jobject thiz, jlong catId)
|
||||
JNIEnv *, jclass, jlong catId)
|
||||
{
|
||||
frm()->GetBookmarkManager().PrepareForSearch(static_cast<kml::MarkGroupId>(catId));
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAreAllCategoriesInvisible(
|
||||
JNIEnv * env, jobject thiz)
|
||||
JNIEnv *, jclass)
|
||||
{
|
||||
return static_cast<jboolean>(frm()->GetBookmarkManager().AreAllCategoriesInvisible());
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAreAllCategoriesVisible(
|
||||
JNIEnv * env, jobject thiz)
|
||||
JNIEnv *, jclass)
|
||||
{
|
||||
return static_cast<jboolean>(frm()->GetBookmarkManager().AreAllCategoriesVisible());
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetAllCategoriesVisibility(
|
||||
JNIEnv * env, jobject thiz, jboolean visible)
|
||||
JNIEnv *, jclass, jboolean visible)
|
||||
{
|
||||
frm()->GetBookmarkManager().SetAllCategoriesVisibility(static_cast<bool>(visible));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativePrepareFileForSharing(
|
||||
JNIEnv * env, jobject thiz, jlong catId)
|
||||
JNIEnv * env, jclass, jlong catId)
|
||||
{
|
||||
frm()->GetBookmarkManager().PrepareFileForSharing(static_cast<kml::MarkGroupId>(catId),
|
||||
[env](BookmarkManager::SharingResult const & result)
|
||||
|
@ -665,7 +614,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativePrepareFileForShar
|
|||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeIsCategoryEmpty(
|
||||
JNIEnv * env, jobject thiz, jlong catId)
|
||||
JNIEnv *, jclass, jlong catId)
|
||||
{
|
||||
return static_cast<jboolean>(frm()->GetBookmarkManager().IsCategoryEmpty(
|
||||
static_cast<kml::MarkGroupId>(catId)));
|
||||
|
@ -673,14 +622,14 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeIsCategoryEmpty(
|
|||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetNotificationsEnabled(
|
||||
JNIEnv * env, jobject thiz, jboolean enabled)
|
||||
JNIEnv *, jclass, jboolean enabled)
|
||||
{
|
||||
frm()->GetBookmarkManager().SetNotificationsEnabled(static_cast<bool>(enabled));
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeAreNotificationsEnabled(
|
||||
JNIEnv * env, jobject thiz)
|
||||
JNIEnv *, jclass)
|
||||
{
|
||||
return static_cast<jboolean>(frm()->GetBookmarkManager().AreNotificationsEnabled());
|
||||
}
|
||||
|
@ -714,17 +663,6 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetChildrenCategor
|
|||
return MakeCategories(env, ids);
|
||||
}
|
||||
|
||||
JNIEXPORT jobjectArray JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetChildrenCollections(JNIEnv *env,
|
||||
jobject,
|
||||
jlong parentId)
|
||||
{
|
||||
auto const & bm = frm()->GetBookmarkManager();
|
||||
auto const ids = bm.GetChildrenCollections(static_cast<kml::MarkGroupId>(parentId));
|
||||
|
||||
return MakeCategories(env, ids);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeHasLastSortingType(
|
||||
JNIEnv *, jobject, jlong catId)
|
||||
|
@ -799,14 +737,14 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetSortedCategory(
|
|||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkName(
|
||||
JNIEnv * env, jobject thiz, jlong bmk)
|
||||
JNIEnv * env, jclass, jlong bmk)
|
||||
{
|
||||
return jni::ToJavaString(env, getBookmark(bmk)->GetPreferredName());
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkFeatureType(
|
||||
JNIEnv * env, jobject thiz, jlong bmk)
|
||||
JNIEnv * env, jclass, jlong bmk)
|
||||
{
|
||||
return jni::ToJavaString(env,
|
||||
kml::GetLocalizedFeatureType(getBookmark(bmk)->GetData().m_featureTypes));
|
||||
|
@ -814,14 +752,14 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkFeature
|
|||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkDescription(
|
||||
JNIEnv * env, jobject thiz, jlong bmk)
|
||||
JNIEnv * env, jclass, jlong bmk)
|
||||
{
|
||||
return jni::ToJavaString(env, getBookmark(bmk)->GetDescription());
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkColor(
|
||||
JNIEnv * env, jobject thiz, jlong bmk)
|
||||
JNIEnv *, jclass, jlong bmk)
|
||||
{
|
||||
auto const * mark = getBookmark(bmk);
|
||||
return static_cast<jint>(mark != nullptr ? mark->GetColor()
|
||||
|
@ -830,7 +768,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkColor(
|
|||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkIcon(
|
||||
JNIEnv * env, jobject thiz, jlong bmk)
|
||||
JNIEnv *, jclass, jlong bmk)
|
||||
{
|
||||
auto const * mark = getBookmark(bmk);
|
||||
return static_cast<jint>(mark != nullptr ? mark->GetData().m_icon
|
||||
|
@ -839,7 +777,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkIcon(
|
|||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetBookmarkParams(
|
||||
JNIEnv * env, jobject thiz, jlong bmk,
|
||||
JNIEnv * env, jclass, jlong bmk,
|
||||
jstring name, jint color, jstring descr)
|
||||
{
|
||||
auto const * mark = getBookmark(bmk);
|
||||
|
@ -858,7 +796,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetBookmarkParams(
|
|||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeChangeBookmarkCategory(
|
||||
JNIEnv * env, jobject thiz, jlong oldCat, jlong newCat, jlong bmk)
|
||||
JNIEnv *, jclass, jlong oldCat, jlong newCat, jlong bmk)
|
||||
{
|
||||
g_framework->MoveBookmark(static_cast<kml::MarkId>(bmk), static_cast<kml::MarkGroupId>(oldCat),
|
||||
static_cast<kml::MarkGroupId>(newCat));
|
||||
|
@ -866,28 +804,28 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeChangeBookmarkCate
|
|||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkXY(
|
||||
JNIEnv * env, jobject thiz, jlong bmk)
|
||||
JNIEnv * env, jclass, jlong bmk)
|
||||
{
|
||||
return jni::GetNewParcelablePointD(env, getBookmark(bmk)->GetPivot());
|
||||
}
|
||||
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkScale(
|
||||
JNIEnv * env, jobject thiz, jlong bmk)
|
||||
JNIEnv *, jclass, jlong bmk)
|
||||
{
|
||||
return getBookmark(bmk)->GetScale();
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeEncode2Ge0Url(
|
||||
JNIEnv * env, jobject thiz, jlong bmk, jboolean addName)
|
||||
JNIEnv * env, jclass, jlong bmk, jboolean addName)
|
||||
{
|
||||
return jni::ToJavaString(env, frm()->CodeGe0url(getBookmark(bmk), addName));
|
||||
}
|
||||
|
||||
JNIEXPORT jobject JNICALL
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkAddress(
|
||||
JNIEnv * env, jobject thiz, jlong bmkId)
|
||||
JNIEnv * env, jclass, jlong bmkId)
|
||||
{
|
||||
auto const address = frm()->GetAddressAtPoint(getBookmark(bmkId)->GetPivot()).FormatAddress();
|
||||
return jni::ToJavaString(env, address);
|
||||
|
@ -895,15 +833,15 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetBookmarkAddress
|
|||
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetElevationCurPositionDistance(
|
||||
JNIEnv * env, jclass clazz, jlong trackId)
|
||||
JNIEnv *, jclass, jlong trackId)
|
||||
{
|
||||
auto & bm = frm()->GetBookmarkManager();
|
||||
auto const & bm = frm()->GetBookmarkManager();
|
||||
return static_cast<jdouble>(bm.GetElevationMyPosition(static_cast<kml::TrackId>(trackId)));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetElevationCurrentPositionChangedListener(
|
||||
JNIEnv * env, jclass clazz)
|
||||
JNIEnv * env, jclass)
|
||||
{
|
||||
frm()->GetBookmarkManager().SetElevationMyPositionChangedCallback(
|
||||
std::bind(&OnElevationCurPositionChanged, env));
|
||||
|
@ -911,14 +849,14 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetElevationCurren
|
|||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeRemoveElevationCurrentPositionChangedListener(
|
||||
JNIEnv * env, jclass)
|
||||
JNIEnv *, jclass)
|
||||
{
|
||||
frm()->GetBookmarkManager().SetElevationMyPositionChangedCallback(nullptr);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetElevationActivePoint(
|
||||
JNIEnv *env, jclass clazz, jlong trackId, jdouble distanceInMeters)
|
||||
JNIEnv *, jclass, jlong trackId, jdouble distanceInMeters)
|
||||
{
|
||||
auto & bm = frm()->GetBookmarkManager();
|
||||
bm.SetElevationActivePoint(static_cast<kml::TrackId>(trackId),
|
||||
|
@ -927,7 +865,7 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetElevationActive
|
|||
|
||||
JNIEXPORT jdouble JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetElevationActivePointDistance(
|
||||
JNIEnv *env, jclass clazz, jlong trackId)
|
||||
JNIEnv *, jclass, jlong trackId)
|
||||
{
|
||||
auto & bm = frm()->GetBookmarkManager();
|
||||
return static_cast<jdouble>(bm.GetElevationActivePoint(static_cast<kml::TrackId>(trackId)));
|
||||
|
@ -935,14 +873,14 @@ Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeGetElevationActive
|
|||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeSetElevationActiveChangedListener(
|
||||
JNIEnv *env, jclass clazz)
|
||||
JNIEnv *env, jclass)
|
||||
{
|
||||
frm()->GetBookmarkManager().SetElevationActivePointChangedCallback(std::bind(&OnElevationActivePointChanged, env));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_maps_bookmarks_data_BookmarkManager_nativeRemoveElevationActiveChangedListener(
|
||||
JNIEnv *env, jclass)
|
||||
JNIEnv *, jclass)
|
||||
{
|
||||
frm()->GetBookmarkManager().SetElevationActivePointChangedCallback(nullptr);
|
||||
}
|
||||
|
|
|
@ -24,17 +24,17 @@ std::string Platform::GetMemoryInfo() const
|
|||
if (env == nullptr)
|
||||
return std::string();
|
||||
|
||||
static std::shared_ptr<jobject> classMemLogging = jni::make_global_ref(env->FindClass("com/mapswithme/util/log/MemLogging"));
|
||||
ASSERT(classMemLogging, ());
|
||||
static std::shared_ptr<jobject> classLogsManager = jni::make_global_ref(env->FindClass("com/mapswithme/util/log/LogsManager"));
|
||||
ASSERT(classLogsManager, ());
|
||||
|
||||
jobject context = android::Platform::Instance().GetContext();
|
||||
static jmethodID const getMemoryInfoId
|
||||
= jni::GetStaticMethodID(env,
|
||||
static_cast<jclass>(*classMemLogging),
|
||||
static_cast<jclass>(*classLogsManager),
|
||||
"getMemoryInfo",
|
||||
"(Landroid/content/Context;)Ljava/lang/String;");
|
||||
jstring const memInfoString = static_cast<jstring>(env->CallStaticObjectMethod(
|
||||
static_cast<jclass>(*classMemLogging), getMemoryInfoId, context));
|
||||
static_cast<jclass>(*classLogsManager), getMemoryInfoId, context));
|
||||
ASSERT(memInfoString, ());
|
||||
|
||||
return jni::ToNativeString(env, memInfoString);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
extern "C" {
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_mapswithme_util_log_LoggerFactory_nativeToggleCoreDebugLogs(
|
||||
Java_com_mapswithme_util_log_LogsManager_nativeToggleCoreDebugLogs(
|
||||
JNIEnv * /*env*/, jclass /*clazz*/, jboolean enabled)
|
||||
{
|
||||
jni::ToggleDebugLogs(enabled);
|
|
@ -1,4 +1,3 @@
|
|||
com/google/firebase/iid/Registrar.class
|
||||
com/mapswithme/maps/api/ParsingResult.class
|
||||
com/mapswithme/maps/bookmarks/data/Bookmark.class
|
||||
com/mapswithme/maps/bookmarks/data/ElevationInfo.class
|
||||
|
@ -14,11 +13,8 @@ com/mapswithme/util/HttpUploader$Result.class
|
|||
com/mapswithme/util/HttpUploader.class
|
||||
com/mapswithme/util/KeyValue.class
|
||||
com/mapswithme/util/SharedPropertiesUtils.class
|
||||
com/mapswithme/util/log/BaseLogger.class
|
||||
com/mapswithme/util/log/FileLoggerStrategy.class
|
||||
com/mapswithme/util/log/LogCatStrategy.class
|
||||
com/mapswithme/util/log/LoggerFactory.class
|
||||
com/mapswithme/util/log/ZipLogsTask.class
|
||||
com/mapswithme/util/log/Logger.class
|
||||
com/mapswithme/util/log/LogsManager.class
|
||||
com/mapswithme/util/NetworkPolicy.class
|
||||
com/mapswithme/util/sharing/ShareableInfoProvider.class
|
||||
com/mapswithme/util/Utils.class
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
# obfuscate supportV7 menu subclasses. it fixes bug with some Samsung and other devices ROMS based on android 4.2.2.
|
||||
# more details here : https://code.google.com/p/android/issues/detail?id=78377
|
||||
# For some reason, this line disables optimizations and avoids crashes due to missing @Keep attributes.
|
||||
# Looks like R8 keeps EVERYTHING except that unused support lib :)
|
||||
# TODO: Remove this line after properly marking all JNI-called classes and methods with @Keep.
|
||||
# Also remove everything else what is not needed.
|
||||
-keep class !android.support.v7.internal.view.menu.**,** {*;}
|
||||
# support library bug
|
||||
-dontwarn android.support.**
|
||||
|
||||
# parse
|
||||
-dontwarn com.squareup.okhttp.**
|
||||
-dontwarn okio.**
|
||||
|
||||
-dontoptimize
|
||||
-keepattributes **
|
||||
|
||||
# Gson support
|
||||
-keep class com.mapswithme.util.Gsonable
|
||||
|
@ -19,6 +14,14 @@
|
|||
!transient <fields>;
|
||||
}
|
||||
|
||||
# Enabling shrinking causes
|
||||
# Execution failed for task ':minifyFdroidReleaseWithR8'.
|
||||
# > com.android.tools.r8.CompilationFailedException: Compilation failed to complete
|
||||
# Optimizing leads to crashes like
|
||||
# No pending exception expected: java.lang.ClassNotFoundException: Didn't find class "com.mapswithme.util.HttpClient"
|
||||
# It requires to manually mark all methods and classes called from NDK.
|
||||
-dontoptimize
|
||||
|
||||
-keepnames class * implements com.mapswithme.util.Gsonable {
|
||||
!transient <fields>;
|
||||
}
|
||||
|
|
|
@ -678,6 +678,7 @@
|
|||
<string name="type.amenity.bench">مقعد طويل</string>
|
||||
<string name="type.amenity.bicycle_parking">أماكن وقوف للدراجات</string>
|
||||
<string name="type.amenity.bicycle_rental">تأجير دراجات</string>
|
||||
<string name="type.amenity.bicycle_repair_station">محطة تصليح الدراجات</string>
|
||||
<string name="type.amenity.biergarten">متجر بيرة</string>
|
||||
<string name="type.amenity.brothel">دعارة</string>
|
||||
<string name="type.amenity.bureau_de_change">تحويل عملات</string>
|
||||
|
@ -791,10 +792,12 @@
|
|||
<string name="type.building.garage">جراج</string>
|
||||
<string name="type.building.has_parts">مبنى</string>
|
||||
<string name="type.building.train_station">محطة سكك حديدية</string>
|
||||
<string name="type.cemetery.grave">ﺮﻴﻄﺧ</string>
|
||||
<string name="type.craft.brewery">مصنع جعة</string>
|
||||
<string name="type.craft.carpenter">نجار</string>
|
||||
<string name="type.craft.electrician">كهربائي</string>
|
||||
<string name="type.craft.gardener">مهندس مناظر</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">تكييف</string>
|
||||
<string name="type.craft.metal_construction">عامل معادن</string>
|
||||
<string name="type.craft.painter">رسام</string>
|
||||
|
@ -1126,6 +1129,7 @@
|
|||
<string name="type.natural.glacier">كتلة جليدية</string>
|
||||
<string name="type.natural.grassland">ملعب</string>
|
||||
<string name="type.natural.water.lake">بحيرة</string>
|
||||
<string name="type.natural.water.lock">ﻞﻔﻘﻟﺍ ﺔﻓﺮﻏ</string>
|
||||
<string name="type.natural.water.pond">بركة</string>
|
||||
<string name="type.natural.water.reservoir">خزان</string>
|
||||
<string name="type.natural.water.basin">حوض المياه</string>
|
||||
|
|
|
@ -747,6 +747,12 @@
|
|||
<string name="type.barrier.chain">Ланцуг</string>
|
||||
<string name="type.barrier.lift_gate">Шлагбаўм</string>
|
||||
<string name="type.barrier.swing_gate">Шлагбаўм</string>
|
||||
<string name="type.cemetery.grave">Магіла</string>
|
||||
<string name="type.craft.beekeeper">Пчаляр</string>
|
||||
<string name="type.craft.blacksmith">Кузня</string>
|
||||
<string name="type.craft.brewery">Крафтавы бровар</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Ацяпленне, вентыляцыя і кандыцыянаванне</string>
|
||||
<string name="type.craft.metal_construction">Металаканструкцыі</string>
|
||||
<string name="type.cuisine.bubble_tea">Чай з бурбалкамі</string>
|
||||
<string name="type.emergency.defibrillator">Дэфібрылятар</string>
|
||||
|
@ -861,6 +867,10 @@
|
|||
<string name="type.mountain_pass">Перавал</string>
|
||||
<string name="type.natural.beach.sand">Пяшчаны пляж</string>
|
||||
<string name="type.natural.beach.gravel">Галечны пляж</string>
|
||||
<string name="type.natural.cliff">Уцёс</string>
|
||||
<string name="type.natural.earth_bank">Абрыў</string>
|
||||
<string name="type.man_made.embankment">Насып</string>
|
||||
<string name="type.natural.water.lock">Шлюзавая камера</string>
|
||||
<string name="type.natural.water.pond">Сажалка</string>
|
||||
<string name="type.natural.water.reservoir">Вадасховішча</string>
|
||||
<string name="type.natural.water.basin">Рэзервуар</string>
|
||||
|
|
|
@ -639,6 +639,9 @@
|
|||
|
||||
<!-- SECTION: Types: Recycling -->
|
||||
<string name="type.recycling.batteries">Батерии</string>
|
||||
<string name="type.cemetery.grave">Гроб</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Отопление, вентилация и климатизация</string>
|
||||
<string name="type.craft.metal_construction">Метални конструкции</string>
|
||||
<string name="type.healthcare.laboratory">Медицинска лаборатория</string>
|
||||
|
||||
|
@ -736,6 +739,7 @@
|
|||
<string name="type.historic.archaeological_site">Археологически сайт</string>
|
||||
<string name="type.landuse.basin">Резервоар</string>
|
||||
<string name="type.leisure.picnic_table">Маса за пикник</string>
|
||||
<string name="type.natural.water.lock">Заключваща камера</string>
|
||||
<string name="type.natural.water.reservoir">Резервоар</string>
|
||||
<string name="type.natural.water.basin">Резервоар</string>
|
||||
<string name="type.natural.water">Воден басейн</string>
|
||||
|
|
|
@ -676,6 +676,7 @@
|
|||
<string name="type.amenity.bench">Lavička</string>
|
||||
<string name="type.amenity.bicycle_parking">Parkování kol</string>
|
||||
<string name="type.amenity.bicycle_rental">Půjčovna kol</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Stanice na opravu jízdních kol</string>
|
||||
<string name="type.amenity.biergarten">Hospoda se zahrádkou</string>
|
||||
<string name="type.amenity.brothel">Nevěstinec</string>
|
||||
<string name="type.amenity.bureau_de_change">Směnárna</string>
|
||||
|
@ -787,10 +788,12 @@
|
|||
<string name="type.building.garage">Garáž</string>
|
||||
<string name="type.building.has_parts">Stavba</string>
|
||||
<string name="type.building.train_station">Železniční stanice</string>
|
||||
<string name="type.cemetery.grave">Hrob</string>
|
||||
<string name="type.craft.brewery">Pivovar</string>
|
||||
<string name="type.craft.carpenter">Truhlář</string>
|
||||
<string name="type.craft.electrician">Elektrikář</string>
|
||||
<string name="type.craft.gardener">Zahradník</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">HVAC</string>
|
||||
<string name="type.craft.metal_construction">Kovodílna</string>
|
||||
<string name="type.craft.painter">Malíř</string>
|
||||
|
@ -1116,10 +1119,13 @@
|
|||
<string name="type.natural.beach">Pláž</string>
|
||||
<string name="type.natural.cape">Mys</string>
|
||||
<string name="type.natural.cave_entrance">Jeskyně</string>
|
||||
<string name="type.natural.cliff">Útes</string>
|
||||
<string name="type.man_made.embankment">Násyp</string>
|
||||
<string name="type.natural.geyser">Gejzír</string>
|
||||
<string name="type.natural.glacier">Ledovec</string>
|
||||
<string name="type.natural.grassland">Pole</string>
|
||||
<string name="type.natural.water.lake">Jezero</string>
|
||||
<string name="type.natural.water.lock">Zámková komora</string>
|
||||
<string name="type.natural.water.pond">Rybník</string>
|
||||
<string name="type.natural.water.reservoir">Nádrž</string>
|
||||
<string name="type.natural.water.basin">Vodní nádrž</string>
|
||||
|
|
|
@ -675,6 +675,7 @@
|
|||
<string name="type.amenity.bench">Bænk</string>
|
||||
<string name="type.amenity.bicycle_parking">Cykelparkering</string>
|
||||
<string name="type.amenity.bicycle_rental">Cykeludlejning</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Cykelreparationsstation</string>
|
||||
<string name="type.amenity.brothel">Bordel</string>
|
||||
<string name="type.amenity.bureau_de_change">Vekselbureau</string>
|
||||
<string name="type.amenity.bus_station">Busstation</string>
|
||||
|
@ -781,10 +782,12 @@
|
|||
<string name="type.building.address">Bygning</string>
|
||||
<string name="type.building.has_parts">Bygning</string>
|
||||
<string name="type.building.train_station">Togstation</string>
|
||||
<string name="type.cemetery.grave">Grav</string>
|
||||
<string name="type.craft.brewery">Bryggeri</string>
|
||||
<string name="type.craft.carpenter">Tømrer</string>
|
||||
<string name="type.craft.electrician">Elektriker</string>
|
||||
<string name="type.craft.gardener">Gartner</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Blikkenslager</string>
|
||||
<string name="type.craft.metal_construction">Metalarbejder</string>
|
||||
<string name="type.craft.painter">Maler</string>
|
||||
|
@ -1111,6 +1114,7 @@
|
|||
<string name="type.natural.glacier">Gletsjer</string>
|
||||
<string name="type.natural.grassland">Mark</string>
|
||||
<string name="type.natural.water.lake">Sø</string>
|
||||
<string name="type.natural.water.lock">Låsekammer</string>
|
||||
<string name="type.natural.water.pond">Dam</string>
|
||||
<string name="type.natural.water.reservoir">Reservoir</string>
|
||||
<string name="type.natural.water.basin">Vandbassin</string>
|
||||
|
|
|
@ -708,6 +708,7 @@
|
|||
<string name="type.amenity.bench">Parkbank</string>
|
||||
<string name="type.amenity.bicycle_parking">Fahrradständer</string>
|
||||
<string name="type.amenity.bicycle_rental">Fahrradverleih</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Fahrrad-Reparaturstation</string>
|
||||
<string name="type.amenity.brothel">Bordell</string>
|
||||
<string name="type.amenity.bureau_de_change">Geldwechselstelle</string>
|
||||
<string name="type.amenity.bus_station">Busbahnhof</string>
|
||||
|
@ -852,10 +853,12 @@
|
|||
<string name="type.building.address">Gebäude</string>
|
||||
<string name="type.building.has_parts">Gebäude</string>
|
||||
<string name="type.building.train_station">Bahnhof</string>
|
||||
<string name="type.cemetery.grave">Grab</string>
|
||||
<string name="type.craft.brewery">Brauerei</string>
|
||||
<string name="type.craft.carpenter">Zimmermann</string>
|
||||
<string name="type.craft.electrician">Elektriker</string>
|
||||
<string name="type.craft.gardener">Landschaftsgärtner</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Heizung</string>
|
||||
<string name="type.craft.metal_construction">Schlosser</string>
|
||||
<string name="type.craft.painter">Maler</string>
|
||||
|
@ -1249,6 +1252,7 @@
|
|||
<string name="type.natural.heath">Heide</string>
|
||||
<string name="type.natural.hot_spring">Thermalquelle</string>
|
||||
<string name="type.natural.water.lake">See</string>
|
||||
<string name="type.natural.water.lock">Schleusenkammer</string>
|
||||
<string name="type.natural.water.pond">Teich</string>
|
||||
<string name="type.natural.water.reservoir">Reservoir</string>
|
||||
<string name="type.natural.water.basin">Wasserbecken</string>
|
||||
|
@ -1528,7 +1532,6 @@
|
|||
<string name="type.waterway.dock">Dock</string>
|
||||
<string name="type.waterway.drain">Abfluss</string>
|
||||
<string name="type.waterway.drain.tunnel">Abfluss</string>
|
||||
<string name="type.waterway.lock">Schleuse</string>
|
||||
<string name="type.waterway.lock_gate">Schleusentor</string>
|
||||
<string name="type.waterway.river">Fluss</string>
|
||||
<string name="type.waterway.river.tunnel">Fluss</string>
|
||||
|
|
|
@ -787,10 +787,12 @@
|
|||
<string name="type.building.garage">Γκαράζ</string>
|
||||
<string name="type.building.has_parts">Κτίριο</string>
|
||||
<string name="type.building.train_station">Σιδηροδρομικός σταθμός</string>
|
||||
<string name="type.cemetery.grave">Τάφος</string>
|
||||
<string name="type.craft.brewery">Ζυθοποιείο</string>
|
||||
<string name="type.craft.carpenter">Ξυλουργός</string>
|
||||
<string name="type.craft.electrician">Ηλεκτρολόγος</string>
|
||||
<string name="type.craft.gardener">Κηπουρός</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Ψυκτικός</string>
|
||||
<string name="type.craft.metal_construction">Μεταλλουργός</string>
|
||||
<string name="type.craft.painter">Μπογιατζής</string>
|
||||
|
@ -1123,6 +1125,7 @@
|
|||
<string name="type.natural.glacier">Παγετώνας</string>
|
||||
<string name="type.natural.grassland">Λιβάδι</string>
|
||||
<string name="type.natural.water.lake">Λίμνη</string>
|
||||
<string name="type.natural.water.lock">Θάλαμος κλειδαριάς</string>
|
||||
<string name="type.natural.water.pond">Δεξαμενή</string>
|
||||
<string name="type.natural.water.reservoir">Δεξαμενή</string>
|
||||
<string name="type.natural.water.basin">Μια λεκάνη νερού</string>
|
||||
|
|
|
@ -708,6 +708,7 @@
|
|||
<string name="type.amenity.bench">Banco</string>
|
||||
<string name="type.amenity.bicycle_parking">Aparcamiento de bicis</string>
|
||||
<string name="type.amenity.bicycle_rental">Alquiler de bicicletas</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Estación de reparación de bicicletas</string>
|
||||
<string name="type.amenity.biergarten">Biergarten</string>
|
||||
<string name="type.amenity.brothel">Burdel</string>
|
||||
<string name="type.amenity.bureau_de_change">Cambio de divisas</string>
|
||||
|
@ -865,10 +866,12 @@
|
|||
<string name="type.building.has_parts">Edificio</string>
|
||||
<string name="type.building.train_station">Estación de tren</string>
|
||||
<string name="type.building.warehouse">Almacén</string>
|
||||
<string name="type.cemetery.grave">Tumba</string>
|
||||
<string name="type.craft.brewery">Fábrica de cerveza</string>
|
||||
<string name="type.craft.carpenter">Carpintero</string>
|
||||
<string name="type.craft.electrician">Electricista</string>
|
||||
<string name="type.craft.gardener">Paisajista</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Aire acondicionado</string>
|
||||
<string name="type.craft.metal_construction">Trabajador del metal</string>
|
||||
<string name="type.craft.painter">Pintor</string>
|
||||
|
@ -1201,6 +1204,7 @@
|
|||
<string name="type.natural.glacier">Glaciar</string>
|
||||
<string name="type.natural.grassland">Campo</string>
|
||||
<string name="type.natural.water.lake">Lago</string>
|
||||
<string name="type.natural.water.lock">Cámara de bloqueo</string>
|
||||
<string name="type.natural.water.pond">Estanque</string>
|
||||
<string name="type.natural.water.reservoir">Embalse</string>
|
||||
<string name="type.natural.water.basin">Cuenca</string>
|
||||
|
|
|
@ -848,10 +848,12 @@
|
|||
<string name="type.building.has_parts">Eraikin</string>
|
||||
<string name="type.building.train_station">Tren geltokian</string>
|
||||
<string name="type.building.warehouse">Denda</string>
|
||||
<string name="type.cemetery.grave">Hilobia</string>
|
||||
<string name="type.craft.brewery">Garagardo fabrika</string>
|
||||
<string name="type.craft.carpenter">Arotza</string>
|
||||
<string name="type.craft.electrician">Elektrizista teknikaria</string>
|
||||
<string name="type.craft.gardener">Paisaia</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Aire girotua</string>
|
||||
<string name="type.craft.metal_construction">Metalgintzako langilea</string>
|
||||
<string name="type.craft.painter">Margolaria</string>
|
||||
|
@ -1183,6 +1185,7 @@
|
|||
<string name="type.natural.glacier">Glaziarra</string>
|
||||
<string name="type.natural.grassland">Landa</string>
|
||||
<string name="type.natural.water.lake">Lakua</string>
|
||||
<string name="type.natural.water.lock">Sarraila Ganbera</string>
|
||||
<string name="type.natural.water.pond">Urmaela</string>
|
||||
<string name="type.natural.water.reservoir">Urtegia</string>
|
||||
<string name="type.natural.water.basin">Arroa</string>
|
||||
|
|
|
@ -674,6 +674,7 @@
|
|||
<string name="type.amenity.bench">سَکو</string>
|
||||
<string name="type.amenity.bicycle_parking">پارکینگ دوچرخه</string>
|
||||
<string name="type.amenity.bicycle_rental">مکان اجاره دوچرخه</string>
|
||||
<string name="type.amenity.bicycle_repair_station">ایستگاه تعمیر دوچرخه</string>
|
||||
<string name="type.amenity.biergarten">غذا</string>
|
||||
<string name="type.amenity.brothel">فاحشه خانه</string>
|
||||
<string name="type.amenity.bureau_de_change">صرافی</string>
|
||||
|
@ -785,6 +786,7 @@
|
|||
<string name="type.building.garage">گاراژ</string>
|
||||
<string name="type.building.has_parts">ساختمان</string>
|
||||
<string name="type.building.train_station">ایستگاه قطار</string>
|
||||
<string name="type.cemetery.grave">ﺮﺒﻗ</string>
|
||||
<string name="type.craft.brewery">کارخانه ابجوسازی</string>
|
||||
<string name="type.craft.carpenter">نجار</string>
|
||||
<string name="type.craft.electrician">برق کار</string>
|
||||
|
@ -1031,6 +1033,7 @@
|
|||
<string name="type.natural.glacier">یخچال طبیعی</string>
|
||||
<string name="type.natural.grassland">کشتزار</string>
|
||||
<string name="type.natural.water.lake">دریاچه</string>
|
||||
<string name="type.natural.water.lock">ﻞﻔﻗ ﻕﺎﺗﺍ</string>
|
||||
<string name="type.natural.water.pond">تالاب</string>
|
||||
<string name="type.natural.water.reservoir">مخزن</string>
|
||||
<string name="type.natural.water.basin">حوضه آب</string>
|
||||
|
|
|
@ -688,6 +688,7 @@
|
|||
<string name="type.amenity.bench">Penkki</string>
|
||||
<string name="type.amenity.bicycle_parking">Polkupyöräpysäköinti</string>
|
||||
<string name="type.amenity.bicycle_rental">Polkupyöränvuokraus</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Polkupyörän korjausasema</string>
|
||||
<string name="type.amenity.brothel">Bordelli</string>
|
||||
<string name="type.amenity.bureau_de_change">Rahanvaihto</string>
|
||||
<string name="type.amenity.bus_station">Linja-autoasema</string>
|
||||
|
@ -799,10 +800,12 @@
|
|||
<string name="type.building.garage">Autotalli</string>
|
||||
<string name="type.building.has_parts">Rakennus</string>
|
||||
<string name="type.building.train_station">Rautatieasema</string>
|
||||
<string name="type.cemetery.grave">Hauta</string>
|
||||
<string name="type.craft.brewery">Panimo</string>
|
||||
<string name="type.craft.carpenter">Puuseppä</string>
|
||||
<string name="type.craft.electrician">Sähkömies</string>
|
||||
<string name="type.craft.gardener">Puutarhuri</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Ilmastointilaite</string>
|
||||
<string name="type.craft.metal_construction">Metallimies</string>
|
||||
<string name="type.craft.painter">Maalari</string>
|
||||
|
@ -1133,6 +1136,7 @@
|
|||
<string name="type.natural.glacier">Jäätikkö</string>
|
||||
<string name="type.natural.grassland">Pelto</string>
|
||||
<string name="type.natural.water.lake">Järvi</string>
|
||||
<string name="type.natural.water.lock">Lukko kammio</string>
|
||||
<string name="type.natural.water.pond">Lampi</string>
|
||||
<string name="type.natural.water.reservoir">Säiliö</string>
|
||||
<string name="type.natural.water.basin">Vesisäiliö</string>
|
||||
|
|
|
@ -704,6 +704,7 @@
|
|||
<string name="type.amenity.bench">Banc</string>
|
||||
<string name="type.amenity.bicycle_parking">Parking à vélo</string>
|
||||
<string name="type.amenity.bicycle_rental">Location de vélos</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Station de réparation de vélos</string>
|
||||
<string name="type.amenity.brothel">Maison de prostitution</string>
|
||||
<string name="type.amenity.bureau_de_change">Bureau de change</string>
|
||||
<string name="type.amenity.bus_station">Gare routière</string>
|
||||
|
@ -824,11 +825,13 @@
|
|||
<string name="type.building.has_parts">Bâtiment</string>
|
||||
<string name="type.building.train_station">Gare</string>
|
||||
<string name="type.building.warehouse">Entrepôt</string>
|
||||
<string name="type.cemetery.grave">La tombe</string>
|
||||
<string name="type.craft">Artisanat</string>
|
||||
<string name="type.craft.brewery">Brasserie artisanale</string>
|
||||
<string name="type.craft.carpenter">Charpentier</string>
|
||||
<string name="type.craft.electrician">Électricien</string>
|
||||
<string name="type.craft.gardener">Paysagiste</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Climatiseur</string>
|
||||
<string name="type.craft.metal_construction">Métallo</string>
|
||||
<string name="type.craft.painter">Peintre</string>
|
||||
|
@ -1202,6 +1205,7 @@
|
|||
<string name="type.natural.heath">Lande</string>
|
||||
<string name="type.natural.hot_spring">Source chaude</string>
|
||||
<string name="type.natural.water.lake">Lac</string>
|
||||
<string name="type.natural.water.lock">Chambre de verrouillage</string>
|
||||
<string name="type.natural.water.pond">Étang</string>
|
||||
<string name="type.natural.water.reservoir">Réservoir</string>
|
||||
<string name="type.natural.water.basin">Réservoir</string>
|
||||
|
@ -1411,7 +1415,6 @@
|
|||
<string name="type.waterway.ditch">Fossé</string>
|
||||
<string name="type.waterway.ditch.tunnel">Fossé</string>
|
||||
<string name="type.waterway.dock">Cale</string>
|
||||
<string name="type.waterway.lock">Écluse</string>
|
||||
<string name="type.waterway.lock_gate">Porte d\'écluse</string>
|
||||
<string name="type.waterway.river">Rivière</string>
|
||||
<string name="type.waterway.river.tunnel">Rivière</string>
|
||||
|
|
|
@ -674,6 +674,7 @@
|
|||
<string name="type.amenity.bench">Pad</string>
|
||||
<string name="type.amenity.bicycle_parking">Kerékpárparkoló</string>
|
||||
<string name="type.amenity.bicycle_rental">Kerékpárkölcsönző</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Kerékpárjavító állomás</string>
|
||||
<string name="type.amenity.biergarten">Sörkert</string>
|
||||
<string name="type.amenity.brothel">Bordélyház</string>
|
||||
<string name="type.amenity.bureau_de_change">Pénzváltó</string>
|
||||
|
@ -786,10 +787,12 @@
|
|||
<string name="type.building.garage">Garázs</string>
|
||||
<string name="type.building.has_parts">Épület</string>
|
||||
<string name="type.building.train_station">Vonatmegálló</string>
|
||||
<string name="type.cemetery.grave">Sír</string>
|
||||
<string name="type.craft.brewery">Sörfőzde</string>
|
||||
<string name="type.craft.carpenter">Ács</string>
|
||||
<string name="type.craft.electrician">Villanyszerelő</string>
|
||||
<string name="type.craft.gardener">Kertész</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Hűtés-fűtés szerelő</string>
|
||||
<string name="type.craft.metal_construction">Lakatos</string>
|
||||
<string name="type.craft.painter">Festő</string>
|
||||
|
@ -1114,10 +1117,13 @@
|
|||
<string name="type.natural.beach">Strand</string>
|
||||
<string name="type.natural.cape">Hegytető</string>
|
||||
<string name="type.natural.cave_entrance">Barlang</string>
|
||||
<string name="type.natural.cliff">Szikla</string>
|
||||
<string name="type.man_made.embankment">Töltés</string>
|
||||
<string name="type.natural.geyser">Gejzír</string>
|
||||
<string name="type.natural.glacier">Gleccser</string>
|
||||
<string name="type.natural.grassland">Mező</string>
|
||||
<string name="type.natural.water.lake">Tó</string>
|
||||
<string name="type.natural.water.lock">Zsilipkamra</string>
|
||||
<string name="type.natural.water.pond">Tavacska</string>
|
||||
<string name="type.natural.water.reservoir">Rezervoár</string>
|
||||
<string name="type.natural.water.basin">Vízgyűjtő</string>
|
||||
|
|
|
@ -782,6 +782,7 @@
|
|||
<string name="type.building.garage">Garasi</string>
|
||||
<string name="type.building.has_parts">Gedung</string>
|
||||
<string name="type.building.train_station">Rel kereta api</string>
|
||||
<string name="type.cemetery.grave">Kuburan</string>
|
||||
<string name="type.craft.brewery">Toko minuman</string>
|
||||
<string name="type.craft.carpenter">Tukang kayu</string>
|
||||
<string name="type.craft.electrician">Tukang listrik</string>
|
||||
|
@ -1113,6 +1114,7 @@
|
|||
<string name="type.natural.glacier">Gletser</string>
|
||||
<string name="type.natural.grassland">Ladang</string>
|
||||
<string name="type.natural.water.lake">Danau</string>
|
||||
<string name="type.natural.water.lock">Ruang Kunci</string>
|
||||
<string name="type.natural.water.pond">Kolam</string>
|
||||
<string name="type.natural.water.reservoir">Waduk</string>
|
||||
<string name="type.natural.water.basin">Sebuah baskom air</string>
|
||||
|
|
|
@ -700,6 +700,7 @@
|
|||
<string name="type.amenity.bench">Panchina</string>
|
||||
<string name="type.amenity.bicycle_parking">Parcheggio biciclette</string>
|
||||
<string name="type.amenity.bicycle_rental">Noleggio biciclette</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Stazione di riparazione biciclette</string>
|
||||
<string name="type.amenity.brothel">Bordello</string>
|
||||
<string name="type.amenity.bureau_de_change">Cambio valute</string>
|
||||
<string name="type.amenity.bus_station">Autostazione</string>
|
||||
|
@ -812,10 +813,12 @@
|
|||
<string name="type.building.address">Edificio</string>
|
||||
<string name="type.building.has_parts">Edificio</string>
|
||||
<string name="type.building.train_station">Stazione ferroviaria</string>
|
||||
<string name="type.cemetery.grave">La tomba</string>
|
||||
<string name="type.craft.brewery">Birrificio</string>
|
||||
<string name="type.craft.carpenter">Falegname</string>
|
||||
<string name="type.craft.electrician">Elettricista</string>
|
||||
<string name="type.craft.gardener">Giardiniere</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Impianti HVAC</string>
|
||||
<string name="type.craft.metal_construction">Fabbro</string>
|
||||
<string name="type.craft.painter">Imbianchino</string>
|
||||
|
@ -1145,6 +1148,7 @@
|
|||
<string name="type.natural.glacier">Ghiacciaio</string>
|
||||
<string name="type.natural.grassland">Campo</string>
|
||||
<string name="type.natural.water.lake">Lago</string>
|
||||
<string name="type.natural.water.lock">Camera di blocco</string>
|
||||
<string name="type.natural.water.pond">Stagno</string>
|
||||
<string name="type.natural.water.reservoir">Serbatoio</string>
|
||||
<string name="type.natural.water.basin">Bacino d\'acqua</string>
|
||||
|
|
|
@ -226,6 +226,7 @@
|
|||
|
||||
<!-- SECTION: Types: Recycling -->
|
||||
<string name="type.recycling.batteries">תוללוס</string>
|
||||
<string name="type.cemetery.grave">רבק</string>
|
||||
<string name="type.cuisine.african">מטבח אפריקאי</string>
|
||||
<string name="type.cuisine.american">מטבח אמריקאי</string>
|
||||
<string name="type.cuisine.arab">מטבח ערבי</string>
|
||||
|
@ -406,6 +407,7 @@
|
|||
<!-- SECTION: Types: Historic -->
|
||||
<string name="type.landuse.basin">אגן מים</string>
|
||||
<string name="type.leisure.picnic_table">קינקיפ ןחלוש</string>
|
||||
<string name="type.natural.water.lock">לוענמ את</string>
|
||||
<string name="type.natural.water.reservoir">מאגר</string>
|
||||
<string name="type.natural.water.basin">אגן מים</string>
|
||||
<string name="type.natural.water">גוף מים</string>
|
||||
|
|
|
@ -683,6 +683,7 @@
|
|||
<string name="type.amenity.bench">ベンチ</string>
|
||||
<string name="type.amenity.bicycle_parking">駐輪場</string>
|
||||
<string name="type.amenity.bicycle_rental">レンタサイクル</string>
|
||||
<string name="type.amenity.bicycle_repair_station">自転車修理ステーション</string>
|
||||
<string name="type.amenity.biergarten">ビアガーデン</string>
|
||||
<string name="type.amenity.brothel">売春宿</string>
|
||||
<string name="type.amenity.bureau_de_change">外貨両替所</string>
|
||||
|
@ -817,11 +818,13 @@
|
|||
<string name="type.building.garage">車庫</string>
|
||||
<string name="type.building.has_parts">建物</string>
|
||||
<string name="type.building.train_station">鉄道駅</string>
|
||||
<string name="type.cemetery.grave">墓</string>
|
||||
<string name="type.craft">工房</string>
|
||||
<string name="type.craft.brewery">醸造所</string>
|
||||
<string name="type.craft.carpenter">大工</string>
|
||||
<string name="type.craft.electrician">電気技師</string>
|
||||
<string name="type.craft.gardener">造園家</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">冷暖房空調</string>
|
||||
<string name="type.craft.metal_construction">金属工</string>
|
||||
<string name="type.craft.painter">塗装工</string>
|
||||
|
@ -1214,6 +1217,7 @@
|
|||
<string name="type.natural.heath">ヒース</string>
|
||||
<string name="type.natural.hot_spring">温泉</string>
|
||||
<string name="type.natural.water.lake">湖</string>
|
||||
<string name="type.natural.water.lock">ロックチャンバー</string>
|
||||
<string name="type.natural.water.pond">池</string>
|
||||
<string name="type.natural.water.reservoir">貯水池</string>
|
||||
<string name="type.natural.water.basin">水地</string>
|
||||
|
|
|
@ -673,6 +673,7 @@
|
|||
<string name="type.amenity.bench">벤치</string>
|
||||
<string name="type.amenity.bicycle_parking">자전거 주차장</string>
|
||||
<string name="type.amenity.bicycle_rental">자전거 대여</string>
|
||||
<string name="type.amenity.bicycle_repair_station">자전거 수리소</string>
|
||||
<string name="type.amenity.biergarten">비어가르텐</string>
|
||||
<string name="type.amenity.brothel">사창가</string>
|
||||
<string name="type.amenity.bureau_de_change">환전</string>
|
||||
|
@ -786,10 +787,12 @@
|
|||
<string name="type.building.garage">차고</string>
|
||||
<string name="type.building.has_parts">건물</string>
|
||||
<string name="type.building.train_station">기차역</string>
|
||||
<string name="type.cemetery.grave">무덤</string>
|
||||
<string name="type.craft.brewery">양조장</string>
|
||||
<string name="type.craft.carpenter">목수</string>
|
||||
<string name="type.craft.electrician">전기기술자</string>
|
||||
<string name="type.craft.gardener">조경사</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">냉난방기</string>
|
||||
<string name="type.craft.metal_construction">금속공</string>
|
||||
<string name="type.craft.painter">페인트공</string>
|
||||
|
@ -1120,6 +1123,7 @@
|
|||
<string name="type.natural.glacier">빙하</string>
|
||||
<string name="type.natural.grassland">밭</string>
|
||||
<string name="type.natural.water.lake">호수</string>
|
||||
<string name="type.natural.water.lock">잠금 챔버</string>
|
||||
<string name="type.natural.water.pond">연못이</string>
|
||||
<string name="type.natural.water.reservoir">저수지</string>
|
||||
<string name="type.natural.water.basin">저수지</string>
|
||||
|
|
|
@ -672,6 +672,7 @@
|
|||
<string name="type.amenity.bench">Benk</string>
|
||||
<string name="type.amenity.bicycle_parking">Sykkelparkering</string>
|
||||
<string name="type.amenity.bicycle_rental">Sykkelutleie</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Sykkelreparasjonsstasjon</string>
|
||||
<string name="type.amenity.biergarten">Uteservering</string>
|
||||
<string name="type.amenity.brothel">Bordell</string>
|
||||
<string name="type.amenity.bureau_de_change">Valutaveksling</string>
|
||||
|
@ -783,10 +784,12 @@
|
|||
<string name="type.building.garage">Verksted</string>
|
||||
<string name="type.building.has_parts">Bygning</string>
|
||||
<string name="type.building.train_station">Togstasjon</string>
|
||||
<string name="type.cemetery.grave">Grav</string>
|
||||
<string name="type.craft.brewery">Bryggeri</string>
|
||||
<string name="type.craft.carpenter">Snekker</string>
|
||||
<string name="type.craft.electrician">Elektriker</string>
|
||||
<string name="type.craft.gardener">Anleggsgartner</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Klimaanlegg</string>
|
||||
<string name="type.craft.metal_construction">Metallarbeider</string>
|
||||
<string name="type.craft.painter">Maler</string>
|
||||
|
@ -1114,6 +1117,7 @@
|
|||
<string name="type.natural.glacier">Isbre</string>
|
||||
<string name="type.natural.grassland">Slette</string>
|
||||
<string name="type.natural.water.lake">Innsjø</string>
|
||||
<string name="type.natural.water.lock">Låsekammer</string>
|
||||
<string name="type.natural.water.pond">Dam</string>
|
||||
<string name="type.natural.water.reservoir">Reservoar</string>
|
||||
<string name="type.natural.water.basin">Vannvask</string>
|
||||
|
|
|
@ -681,6 +681,7 @@
|
|||
<string name="type.amenity.bench">Zitbank</string>
|
||||
<string name="type.amenity.bicycle_parking">Fietsenstalling</string>
|
||||
<string name="type.amenity.bicycle_rental">Fietsverhuur</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Fiets reparatie station</string>
|
||||
<string name="type.amenity.brothel">Bordeel</string>
|
||||
<string name="type.amenity.bureau_de_change">Wisselkantoor</string>
|
||||
<string name="type.amenity.bus_station">Busstation</string>
|
||||
|
@ -787,10 +788,12 @@
|
|||
<string name="type.building.address">Gebouw</string>
|
||||
<string name="type.building.has_parts">Gebouw</string>
|
||||
<string name="type.building.train_station">Station</string>
|
||||
<string name="type.cemetery.grave">Graf</string>
|
||||
<string name="type.craft.brewery">Brouwerij</string>
|
||||
<string name="type.craft.carpenter">Timmerman</string>
|
||||
<string name="type.craft.electrician">Elektricien</string>
|
||||
<string name="type.craft.gardener">Tuinarchitect</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Airconditioning</string>
|
||||
<string name="type.craft.metal_construction">Metaalarbeider</string>
|
||||
<string name="type.craft.painter">Schilder</string>
|
||||
|
@ -1124,6 +1127,7 @@
|
|||
<string name="type.natural.heath">Heide</string>
|
||||
<string name="type.natural.hot_spring">Heetwaterbron</string>
|
||||
<string name="type.natural.water.lake">Meer</string>
|
||||
<string name="type.natural.water.lock">Slotkamer</string>
|
||||
<string name="type.natural.water.pond">Plas</string>
|
||||
<string name="type.natural.water.reservoir">Reservoir</string>
|
||||
<string name="type.natural.water.basin">Waterbassin</string>
|
||||
|
|
|
@ -706,6 +706,7 @@
|
|||
<string name="type.amenity.bench">Ławka</string>
|
||||
<string name="type.amenity.bicycle_parking">Parking dla rowerów</string>
|
||||
<string name="type.amenity.bicycle_rental">Wynajem rowerów</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Stacja naprawy rowerów</string>
|
||||
<string name="type.amenity.biergarten">Ogródek piwny</string>
|
||||
<string name="type.amenity.brothel">Burdel</string>
|
||||
<string name="type.amenity.bureau_de_change">Kantor</string>
|
||||
|
@ -846,11 +847,13 @@
|
|||
<string name="type.building.garage">Garaż</string>
|
||||
<string name="type.building.has_parts">Część budynku</string>
|
||||
<string name="type.building.train_station">Dworzec kolejowy</string>
|
||||
<string name="type.cemetery.grave">Mogiła</string>
|
||||
<string name="type.craft">Rzemiosło</string>
|
||||
<string name="type.craft.brewery">Browar</string>
|
||||
<string name="type.craft.carpenter">Stolarz</string>
|
||||
<string name="type.craft.electrician">Elektryk</string>
|
||||
<string name="type.craft.gardener">Ogrodnik</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Klimatyzacja</string>
|
||||
<string name="type.craft.metal_construction">Ślusarz, obrabiacz metalu</string>
|
||||
<string name="type.craft.painter">Malarz</string>
|
||||
|
@ -1237,6 +1240,7 @@
|
|||
<string name="type.natural.heath">Wrzosowisko</string>
|
||||
<string name="type.natural.hot_spring">Gorące źródło</string>
|
||||
<string name="type.natural.water.lake">Jezioro</string>
|
||||
<string name="type.natural.water.lock">Komora zamka</string>
|
||||
<string name="type.natural.water.pond">Staw</string>
|
||||
<string name="type.natural.water.reservoir">Zbiornik</string>
|
||||
<string name="type.natural.water.basin">Zbiornik</string>
|
||||
|
|
|
@ -720,6 +720,7 @@
|
|||
<string name="type.amenity.bench">Assento</string>
|
||||
<string name="type.amenity.bicycle_parking">Bicicletário</string>
|
||||
<string name="type.amenity.bicycle_rental">Aluguel de bicicletas</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Oficina de conserto de bicicletas</string>
|
||||
<string name="type.amenity.biergarten">Jardim da cerveja</string>
|
||||
<string name="type.amenity.brothel">Bordel</string>
|
||||
<string name="type.amenity.bureau_de_change">Casa de câmbio</string>
|
||||
|
@ -864,11 +865,13 @@
|
|||
<string name="type.building.has_parts">Edifício</string>
|
||||
<string name="type.building.train_station">Estação de trem</string>
|
||||
<string name="type.building.warehouse">Armazém</string>
|
||||
<string name="type.cemetery.grave">Túmulo</string>
|
||||
<string name="type.craft">Ofícios</string>
|
||||
<string name="type.craft.brewery">Cervejaria artesanal</string>
|
||||
<string name="type.craft.carpenter">Carpinteiro</string>
|
||||
<string name="type.craft.electrician">Eletricista</string>
|
||||
<string name="type.craft.gardener">Jardineiro</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Ar-condicionado</string>
|
||||
<string name="type.craft.metal_construction">Serralheiro metálico</string>
|
||||
<string name="type.craft.painter">Pintor</string>
|
||||
|
@ -972,74 +975,75 @@
|
|||
<string name="type.highway">Rodovia</string>
|
||||
<string name="type.highway.bridleway">Caminho para cavaleiros</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.bridleway.bridge">Ponte</string>
|
||||
<string name="type.highway.bridleway.permissive">Caminho para cavaleiros</string>
|
||||
<string name="type.highway.bridleway.bridge">Ponte para cavaleiros</string>
|
||||
<string name="type.highway.bridleway.permissive">Caminho para cavaleiros permissivo</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.bridleway.tunnel">Túnel</string>
|
||||
<string name="type.highway.bridleway.tunnel">Túnel para cavaleiros</string>
|
||||
<string name="type.highway.bus_stop">Ponto de ônibus</string>
|
||||
<string name="type.highway.construction">Pista em construção</string>
|
||||
<string name="type.highway.cycleway">Ciclovia</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.cycleway.bridge">Ponte</string>
|
||||
<string name="type.highway.cycleway.permissive">Ciclovia</string>
|
||||
<string name="type.highway.cycleway.bridge">Ponte para ciclistas</string>
|
||||
<string name="type.highway.cycleway.permissive">Caminho para ciclistas permissivo</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.cycleway.tunnel">Túnel</string>
|
||||
<string name="type.highway.cycleway.tunnel">Túnel para ciclistas</string>
|
||||
<string name="type.highway.elevator">Elevador</string>
|
||||
<string name="type.highway.footway">Caminho pedonal</string>
|
||||
<string name="type.highway.footway.alpine_hiking">Caminho pedonal</string>
|
||||
<string name="type.highway.footway.area">Caminho pedonal</string>
|
||||
<string name="type.highway.footway.area">Área de pedestres</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.footway.bridge">Ponte</string>
|
||||
<string name="type.highway.footway.demanding_alpine_hiking">Caminho pedonal</string>
|
||||
<string name="type.highway.footway.demanding_mountain_hiking">Caminho pedonal</string>
|
||||
<string name="type.highway.footway.difficult_alpine_hiking">Caminho pedonal</string>
|
||||
<string name="type.highway.footway.bridge">Ponte para pedestres</string>
|
||||
<string name="type.highway.footway.demanding_alpine_hiking">Caminho pedonal difícil</string>
|
||||
<string name="type.highway.footway.demanding_mountain_hiking">Caminho pedonal difícil</string>
|
||||
<string name="type.highway.footway.difficult_alpine_hiking">Caminho pedonal difícil</string>
|
||||
<string name="type.highway.footway.hiking">Caminho pedonal</string>
|
||||
<string name="type.highway.footway.mountain_hiking">Caminho pedonal</string>
|
||||
<string name="type.highway.footway.permissive">Caminho pedonal</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.footway.tunnel">Túnel</string>
|
||||
<string name="type.highway.footway.tunnel">Túnel para pedestres</string>
|
||||
<string name="type.highway.ford">Rio raso</string>
|
||||
<string name="type.highway.living_street">Zona de coexistência</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.living_street.bridge">Ponte</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.living_street.tunnel">Túnel</string>
|
||||
<string name="type.highway.living_street.tunnel">Túnel rodoviário</string>
|
||||
<string name="type.highway.motorway">Rodovia</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.motorway.bridge">Ponte</string>
|
||||
<string name="type.highway.motorway.bridge">Ponte rodoviária</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.motorway.tunnel">Túnel</string>
|
||||
<string name="type.highway.motorway.tunnel">Túnel rodoviário</string>
|
||||
<string name="type.highway.motorway_junction">Saída de rodovia</string>
|
||||
<string name="type.highway.motorway_link">Rodovia</string>
|
||||
<string name="type.highway.motorway_link">Acesso a rodovia</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.motorway_link.bridge">Ponte</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.motorway_link.tunnel">Túnel</string>
|
||||
<string name="type.highway.path">Caminho</string>
|
||||
<string name="type.highway.path.alpine_hiking">Caminho</string>
|
||||
<string name="type.highway.path.bicycle">Caminho</string>
|
||||
<string name="type.highway.path.alpine_hiking">Caminho pedonal</string>
|
||||
<string name="type.highway.path.bicycle">Caminho para ciclistas</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.path.bridge">Ponte</string>
|
||||
<string name="type.highway.path.demanding_alpine_hiking">Caminho</string>
|
||||
<string name="type.highway.path.demanding_mountain_hiking">Caminho</string>
|
||||
<string name="type.highway.path.difficult_alpine_hiking">Caminho</string>
|
||||
<string name="type.highway.path.hiking">Caminho</string>
|
||||
<string name="type.highway.path.horse">Caminho</string>
|
||||
<string name="type.highway.path.mountain_hiking">Caminho</string>
|
||||
<string name="type.highway.path.demanding_alpine_hiking">Caminho pedonal difícil</string>
|
||||
<string name="type.highway.path.demanding_mountain_hiking">Caminho pedonal difícil</string>
|
||||
<string name="type.highway.path.difficult_alpine_hiking">Caminho pedonal difícil</string>
|
||||
<string name="type.highway.path.hiking">Caminho pedonal</string>
|
||||
<string name="type.highway.path.horse">Caminho para cavaleiros</string>
|
||||
<string name="type.highway.path.mountain_hiking">Caminho pedonal</string>
|
||||
<string name="type.highway.path.permissive">Caminho</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.path.tunnel">Túnel</string>
|
||||
<string name="type.highway.pedestrian">Rua pedonal</string>
|
||||
<string name="type.highway.pedestrian.area">Rua pedonal</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.pedestrian.bridge">Ponte</string>
|
||||
<string name="type.highway.pedestrian.bridge">Ponte para pedestres</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.pedestrian.tunnel">Túnel</string>
|
||||
<string name="type.highway.pedestrian.tunnel">Túnel para pedestres</string>
|
||||
<string name="type.highway.primary">Estrada</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.primary.bridge">Ponte</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.primary.tunnel">Túnel</string>
|
||||
<string name="type.highway.primary_link">Estrada</string>
|
||||
<string name="type.highway.primary.tunnel">Túnel rodoviário</string>
|
||||
<string name="type.highway.primary_link">Saída de rodovia</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.primary_link.bridge">Ponte</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
|
@ -1050,7 +1054,7 @@
|
|||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.residential.bridge">Ponte</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.residential.tunnel">Túnel</string>
|
||||
<string name="type.highway.residential.tunnel">Túnel residencial</string>
|
||||
<string name="type.highway.rest_area">Área de descanso</string>
|
||||
<string name="type.highway.road">Estrada</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
|
@ -1061,20 +1065,20 @@
|
|||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.secondary.bridge">Ponte</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.secondary.tunnel">Túnel</string>
|
||||
<string name="type.highway.secondary_link">Estrada</string>
|
||||
<string name="type.highway.secondary.tunnel">Túnel rodoviário</string>
|
||||
<string name="type.highway.secondary_link">Saída de rodovia</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.secondary_link.bridge">Ponte</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.secondary_link.tunnel">Túnel</string>
|
||||
<string name="type.highway.secondary_link.tunnel">Túnel rodoviário</string>
|
||||
<string name="type.highway.service">Estrada de acesso ou serviço</string>
|
||||
<string name="type.highway.service.area">Estrada de acesso ou serviço</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.service.bridge">Ponte</string>
|
||||
<string name="type.highway.service.driveway">Estrada de acesso ou serviço</string>
|
||||
<string name="type.highway.service.driveway">Via de acesso</string>
|
||||
<string name="type.highway.service.parking_aisle">Estrada de estacionamento</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.service.tunnel">Túnel</string>
|
||||
<string name="type.highway.service.tunnel">Túnel rodoviário</string>
|
||||
<string name="type.highway.services">Área de serviços de estrada</string>
|
||||
<string name="type.highway.speed_camera">Radar de velocidade</string>
|
||||
<string name="type.highway.steps">Escadas</string>
|
||||
|
@ -1086,12 +1090,12 @@
|
|||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.tertiary.bridge">Ponte</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.tertiary.tunnel">Túnel</string>
|
||||
<string name="type.highway.tertiary_link">Estrada</string>
|
||||
<string name="type.highway.tertiary.tunnel">Túnel rodoviário</string>
|
||||
<string name="type.highway.tertiary_link">Saída de rodovia</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.tertiary_link.bridge">Ponte</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.tertiary_link.tunnel">Túnel</string>
|
||||
<string name="type.highway.tertiary_link.tunnel">Túnel rodoviário</string>
|
||||
<string name="type.highway.track">Estrada rústica</string>
|
||||
<string name="type.highway.track.area">Estrada rústica</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
|
@ -1104,36 +1108,36 @@
|
|||
<string name="type.highway.track.no.access">Estrada rústica</string>
|
||||
<string name="type.highway.track.permissive">Estrada rústica</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.track.tunnel">Túnel</string>
|
||||
<string name="type.highway.track.tunnel">Túnel rodoviário</string>
|
||||
<string name="type.highway.traffic_signals">Semáforo</string>
|
||||
<string name="type.highway.trunk">Via expressa</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.trunk.bridge">Ponte</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.trunk.tunnel">Túnel</string>
|
||||
<string name="type.highway.trunk_link">Via expressa</string>
|
||||
<string name="type.highway.trunk.tunnel">Túnel rodoviário</string>
|
||||
<string name="type.highway.trunk_link">Saída de rodovia</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.trunk_link.bridge">Ponte</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.trunk_link.tunnel">Túnel</string>
|
||||
<string name="type.highway.trunk_link.tunnel">Túnel rodoviário</string>
|
||||
<string name="type.highway.unclassified">Estrada sem classificação</string>
|
||||
<string name="type.highway.unclassified.area">Estrada sem classificação</string>
|
||||
<!-- These translations are used for all type.highway.*.bridge. -->
|
||||
<string name="type.highway.unclassified.bridge">Ponte</string>
|
||||
<!-- These translations are used for all type.highway.*.tunnel. -->
|
||||
<string name="type.highway.unclassified.tunnel">Túnel</string>
|
||||
<string name="type.area_highway.cycleway">Ciclovia</string>
|
||||
<string name="type.highway.unclassified.tunnel">Túnel rodoviário</string>
|
||||
<string name="type.area_highway.cycleway">Caminho para ciclistas</string>
|
||||
<string name="type.area_highway.footway">Caminho pedonal</string>
|
||||
<string name="type.area_highway.living_street">Zona de coexistência</string>
|
||||
<string name="type.area_highway.living_street">Rua residencial</string>
|
||||
<string name="type.area_highway.motorway">Rodovia</string>
|
||||
<string name="type.area_highway.path">Caminho</string>
|
||||
<string name="type.area_highway.pedestrian">Rua pedonal</string>
|
||||
<string name="type.area_highway.pedestrian">Caminho pedonal</string>
|
||||
<string name="type.area_highway.primary">Estrada</string>
|
||||
<string name="type.area_highway.residential">Rua residencial</string>
|
||||
<string name="type.area_highway.secondary">Estrada</string>
|
||||
<string name="type.area_highway.service">Estrada de acesso ou serviço</string>
|
||||
<string name="type.area_highway.tertiary">Estrada</string>
|
||||
<string name="type.area_highway.steps">Escadas</string>
|
||||
<string name="type.area_highway.steps">Travessia</string>
|
||||
<string name="type.area_highway.track">Pista para desportos não motorizados</string>
|
||||
<string name="type.area_highway.trunk">Via expressa</string>
|
||||
<string name="type.area_highway.unclassified">Estrada sem classificação</string>
|
||||
|
@ -1173,6 +1177,7 @@
|
|||
<string name="type.landuse.churchyard">Adro de igreja</string>
|
||||
<string name="type.landuse.commercial">Área comercial</string>
|
||||
<string name="type.landuse.construction">Construção</string>
|
||||
<string name="type.landuse.education">Instituições educacionais</string>
|
||||
<string name="type.landuse.farm">Fazenda</string>
|
||||
<string name="type.landuse.farmland">Campo agrícola</string>
|
||||
<string name="type.landuse.farmyard">Pátio de fazenda</string>
|
||||
|
@ -1239,6 +1244,8 @@
|
|||
<string name="type.man_made.pier">Píer</string>
|
||||
<string name="type.man_made.pipeline">Pipeline</string>
|
||||
<string name="type.man_made.pipeline.overground">Pipeline aéreo</string>
|
||||
<string name="type.man_made.silo">Silo</string>
|
||||
<string name="type.man_made.storage_tank">Tanque de armazenagem</string>
|
||||
<string name="type.man_made.surveillance">Câmara de vigilância</string>
|
||||
<string name="type.man_made.tower">Torre</string>
|
||||
<string name="type.man_made.wastewater_plant">Estação de tratamento de esgoto</string>
|
||||
|
@ -1263,7 +1270,9 @@
|
|||
<string name="type.natural.heath">Charneca</string>
|
||||
<string name="type.natural.hot_spring">Nascente de água quente</string>
|
||||
<string name="type.natural.water.lake">Lago</string>
|
||||
<string name="type.natural.water.lock">Câmara de Bloqueio</string>
|
||||
<string name="type.natural.water.pond">Lagoa</string>
|
||||
<string name="type.natural.water.reservoir">Reservatório</string>
|
||||
<string name="type.natural.water.basin">Reservatório</string>
|
||||
<string name="type.natural.water.river">Rio</string>
|
||||
<string name="type.natural.land">Campo</string>
|
||||
|
@ -1346,7 +1355,7 @@
|
|||
<string name="type.railway.funicular">Funicular</string>
|
||||
<string name="type.railway.funicular.bridge">Funicular</string>
|
||||
<string name="type.railway.funicular.tunnel">Funicular</string>
|
||||
<string name="type.railway.halt">Estação de trem</string>
|
||||
<string name="type.railway.halt">Ponto de parada</string>
|
||||
<string name="type.railway.level_crossing">Passagem em nível</string>
|
||||
<string name="type.railway.light_rail">Metrô de superfície</string>
|
||||
<string name="type.railway.light_rail.bridge">Metrô de superfície</string>
|
||||
|
@ -1544,7 +1553,6 @@
|
|||
<string name="type.waterway.dock">Doca</string>
|
||||
<string name="type.waterway.drain">Valeta de drenagem</string>
|
||||
<string name="type.waterway.drain.tunnel">Valeta de drenagem</string>
|
||||
<string name="type.waterway.lock">Eclusa</string>
|
||||
<string name="type.waterway.lock_gate">Comporta de eclusa</string>
|
||||
<string name="type.waterway.river">Rio</string>
|
||||
<string name="type.waterway.river.tunnel">Rio</string>
|
||||
|
|
|
@ -702,6 +702,7 @@
|
|||
<string name="type.amenity.bench">Assento</string>
|
||||
<string name="type.amenity.bicycle_parking">Estacionamento de bicicletas</string>
|
||||
<string name="type.amenity.bicycle_rental">Aluguer de bicicletas</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Estação de conserto de bicicletas</string>
|
||||
<string name="type.amenity.biergarten">Jardim da cerveja</string>
|
||||
<string name="type.amenity.brothel">Bordel</string>
|
||||
<string name="type.amenity.bureau_de_change">Casa de câmbio</string>
|
||||
|
@ -846,11 +847,13 @@
|
|||
<string name="type.building.has_parts">Edifício</string>
|
||||
<string name="type.building.train_station">Estação de comboios</string>
|
||||
<string name="type.building.warehouse">Armazém</string>
|
||||
<string name="type.cemetery.grave">Túmulo</string>
|
||||
<string name="type.craft">Ofícios</string>
|
||||
<string name="type.craft.brewery">Cervejaria artesanal</string>
|
||||
<string name="type.craft.carpenter">Carpinteiro</string>
|
||||
<string name="type.craft.electrician">Eletricista</string>
|
||||
<string name="type.craft.gardener">Jardineiro</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Instalador de ar-condicionado</string>
|
||||
<string name="type.craft.metal_construction">Serralheiro metálico</string>
|
||||
<string name="type.craft.painter">Pintor</string>
|
||||
|
@ -1245,6 +1248,7 @@
|
|||
<string name="type.natural.heath">Charneca</string>
|
||||
<string name="type.natural.hot_spring">Nascente de água quente</string>
|
||||
<string name="type.natural.water.lake">Lago</string>
|
||||
<string name="type.natural.water.lock">Câmara de Bloqueio</string>
|
||||
<string name="type.natural.water.pond">Lagoa</string>
|
||||
<string name="type.natural.water.reservoir">Reservatório</string>
|
||||
<string name="type.natural.water.basin">Reservatório</string>
|
||||
|
@ -1527,7 +1531,6 @@
|
|||
<string name="type.waterway.dock">Doca</string>
|
||||
<string name="type.waterway.drain">Valeta de drenagem</string>
|
||||
<string name="type.waterway.drain.tunnel">Valeta de drenagem</string>
|
||||
<string name="type.waterway.lock">Eclusa</string>
|
||||
<string name="type.waterway.lock_gate">Comporta de eclusa</string>
|
||||
<string name="type.waterway.river">Rio</string>
|
||||
<string name="type.waterway.river.tunnel">Rio</string>
|
||||
|
|
|
@ -809,6 +809,7 @@
|
|||
<string name="type.building.garage">Garaj</string>
|
||||
<string name="type.building.has_parts">Clădire</string>
|
||||
<string name="type.building.train_station">Feroviar</string>
|
||||
<string name="type.cemetery.grave">Mormânt</string>
|
||||
<string name="type.craft.brewery">Berărie</string>
|
||||
<string name="type.craft.carpenter">Tâmplar</string>
|
||||
<string name="type.craft.gardener">Peisagist</string>
|
||||
|
@ -1139,6 +1140,7 @@
|
|||
<string name="type.natural.glacier">Ghețar</string>
|
||||
<string name="type.natural.grassland">Câmp</string>
|
||||
<string name="type.natural.water.lake">Lac</string>
|
||||
<string name="type.natural.water.lock">Camera de blocare</string>
|
||||
<string name="type.natural.water.pond">Heleșteu</string>
|
||||
<string name="type.natural.water.reservoir">Rezervor</string>
|
||||
<string name="type.natural.water.basin">Bazin de apă</string>
|
||||
|
|
|
@ -509,7 +509,7 @@
|
|||
<string name="editor_share_to_all_dialog_message_1">Убедитесь, что вы не ввели личные данные.</string>
|
||||
<string name="editor_share_to_all_dialog_message_2">Если при проверке изменений возникнут вопросы, мы напишем вам на email.</string>
|
||||
<!-- Text under the version number in the Help dialog. TODO: Synchronize other translations with English. -->
|
||||
<string name="about_description">Organic Maps — быстрые и бесплатные карты, которые работают без Интернета. Все картографические данные берутся из OpenStreetMap.org, там можно самостоятельно исправлять ошибки и добавлять новые объекты. В Organic Maps нет рекламы и сбора пресональных данных. Это проект с открытым исходным кодом, создаваемый энтузиастами в свободное время. Будем рады вашей поддержке и обратной связи!</string>
|
||||
<string name="about_description">Organic Maps — быстрые и бесплатные карты, которые работают без Интернета. Все картографические данные берутся из OpenStreetMap.org, там можно самостоятельно исправлять ошибки и добавлять новые объекты. В Organic Maps нет рекламы и сбора персональных данных. Это проект с открытым исходным кодом, создаваемый энтузиастами в свободное время. Будем рады вашей поддержке и обратной связи!</string>
|
||||
<!-- For the first routing -->
|
||||
<string name="accept">Принять</string>
|
||||
<!-- For the first routing -->
|
||||
|
@ -743,6 +743,7 @@
|
|||
<string name="type.amenity.bench">Скамейка</string>
|
||||
<string name="type.amenity.bicycle_parking">Велостоянка</string>
|
||||
<string name="type.amenity.bicycle_rental">Велопрокат</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Станция ремонта велосипедов</string>
|
||||
<string name="type.amenity.biergarten">Пивная под открытым небом</string>
|
||||
<string name="type.amenity.brothel">Бордель</string>
|
||||
<string name="type.amenity.bureau_de_change">Обмен валюты</string>
|
||||
|
@ -903,17 +904,26 @@
|
|||
<string name="type.building.has_parts">Здание</string>
|
||||
<string name="type.building.train_station">Ж/д вокзал</string>
|
||||
<string name="type.building.warehouse">Склад</string>
|
||||
<string name="type.cemetery.grave">Могила</string>
|
||||
<string name="type.craft">Мастерская</string>
|
||||
<string name="type.craft.brewery">Крафтовое пиво</string>
|
||||
<string name="type.craft.beekeeper">Пчеловод</string>
|
||||
<string name="type.craft.blacksmith">Кузница</string>
|
||||
<string name="type.craft.brewery">Крафтовая пивоварня</string>
|
||||
<string name="type.craft.carpenter">Столяр</string>
|
||||
<string name="type.craft.confectionery">Кондитер</string>
|
||||
<string name="type.craft.electrician">Электрик</string>
|
||||
<string name="type.craft.electronics_repair">Ремонт электроники</string>
|
||||
<string name="type.craft.gardener">Садовник</string>
|
||||
<string name="type.craft.hvac">Кондиционеры</string>
|
||||
<string name="type.craft.handicraft">Ремесленная мастерская</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Отопление, вентиляция и кондиционирование</string>
|
||||
<string name="type.craft.metal_construction">Металлоконструкции</string>
|
||||
<string name="type.craft.painter">Маляр</string>
|
||||
<string name="type.craft.photographer">Фотограф</string>
|
||||
<string name="type.craft.plumber">Сантехник</string>
|
||||
<string name="type.craft.sawmill">Лесопилка</string>
|
||||
<string name="type.craft.shoemaker">Ремонт обуви</string>
|
||||
<string name="type.craft.winery">Винодельня</string>
|
||||
<string name="type.craft.tailor">Ателье</string>
|
||||
<string name="type.cuisine.african">Африканская кухня</string>
|
||||
<string name="type.cuisine.american">Американская кухня</string>
|
||||
|
@ -1306,7 +1316,9 @@
|
|||
<string name="type.natural.beach.gravel">Галечный пляж</string>
|
||||
<string name="type.natural.cape">Мыс</string>
|
||||
<string name="type.natural.cave_entrance">Пещера</string>
|
||||
<string name="type.natural.cliff">Обрыв</string>
|
||||
<string name="type.natural.cliff">Утёс</string>
|
||||
<string name="type.natural.earth_bank">Обрыв</string>
|
||||
<string name="type.man_made.embankment">Насыпь</string>
|
||||
<string name="type.natural.coastline">Береговая линия</string>
|
||||
<string name="type.natural.geyser">Гейзер</string>
|
||||
<string name="type.natural.glacier">Ледник</string>
|
||||
|
@ -1314,6 +1326,7 @@
|
|||
<string name="type.natural.heath">Пустошь</string>
|
||||
<string name="type.natural.hot_spring">Горячий источник</string>
|
||||
<string name="type.natural.water.lake">Озеро</string>
|
||||
<string name="type.natural.water.lock">Шлюзовая камера</string>
|
||||
<string name="type.natural.water.pond">Пруд</string>
|
||||
<string name="type.natural.water.reservoir">Водохранилище</string>
|
||||
<string name="type.natural.water.basin">Резервуар</string>
|
||||
|
@ -1603,7 +1616,6 @@
|
|||
<string name="type.waterway.dock">Причал</string>
|
||||
<string name="type.waterway.drain">Водоотвод</string>
|
||||
<string name="type.waterway.drain.tunnel">Водоотвод</string>
|
||||
<string name="type.waterway.lock">Шлюз</string>
|
||||
<string name="type.waterway.lock_gate">Шлюз</string>
|
||||
<string name="type.waterway.river">Река</string>
|
||||
<string name="type.waterway.river.tunnel">Река</string>
|
||||
|
|
|
@ -785,10 +785,12 @@
|
|||
<string name="type.building.garage">Garáž</string>
|
||||
<string name="type.building.has_parts">Budova</string>
|
||||
<string name="type.building.train_station">Železničná stanica</string>
|
||||
<string name="type.cemetery.grave">Hrob</string>
|
||||
<string name="type.craft.brewery">Pivovar</string>
|
||||
<string name="type.craft.carpenter">Tesár</string>
|
||||
<string name="type.craft.electrician">Elektrikár</string>
|
||||
<string name="type.craft.gardener">Záhradníctvo</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Vzduchotechnika</string>
|
||||
<string name="type.craft.metal_construction">Kovorobotník</string>
|
||||
<string name="type.craft.painter">Maliar natierač</string>
|
||||
|
@ -1112,10 +1114,13 @@
|
|||
<string name="type.natural.bay">Záliv</string>
|
||||
<string name="type.natural.cape">Mys</string>
|
||||
<string name="type.natural.cave_entrance">Jaskyňa</string>
|
||||
<string name="type.natural.cliff">Útes</string>
|
||||
<string name="type.man_made.embankment">Násyp</string>
|
||||
<string name="type.natural.geyser">Gejzír</string>
|
||||
<string name="type.natural.glacier">Ľadovec</string>
|
||||
<string name="type.natural.grassland">Lúka</string>
|
||||
<string name="type.natural.water.lake">Jazero</string>
|
||||
<string name="type.natural.water.lock">Uzamykacia komora</string>
|
||||
<string name="type.natural.water.pond">Rybník</string>
|
||||
<string name="type.natural.water.reservoir">Nádrž</string>
|
||||
<string name="type.natural.water.basin">Vodná nádrž</string>
|
||||
|
|
|
@ -782,10 +782,12 @@
|
|||
<string name="type.building.address">Byggnad</string>
|
||||
<string name="type.building.has_parts">Byggnad</string>
|
||||
<string name="type.building.train_station">Tågstation</string>
|
||||
<string name="type.cemetery.grave">Grav</string>
|
||||
<string name="type.craft.brewery">Bryggeri</string>
|
||||
<string name="type.craft.carpenter">Snickare</string>
|
||||
<string name="type.craft.electrician">Elektriker</string>
|
||||
<string name="type.craft.gardener">Trädgårdsmästare</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Vvs</string>
|
||||
<string name="type.craft.metal_construction">Metallarbetare</string>
|
||||
<string name="type.craft.painter">Målare</string>
|
||||
|
@ -1112,6 +1114,7 @@
|
|||
<string name="type.natural.glacier">Glaciär</string>
|
||||
<string name="type.natural.grassland">Fältet</string>
|
||||
<string name="type.natural.water.lake">Sjö</string>
|
||||
<string name="type.natural.water.lock">Låskammare</string>
|
||||
<string name="type.natural.water.pond">Damm</string>
|
||||
<string name="type.natural.water.reservoir">Reservoar</string>
|
||||
<string name="type.natural.water.basin">Vattenbassäng</string>
|
||||
|
|
|
@ -223,6 +223,7 @@
|
|||
<!-- SECTION: Types -->
|
||||
<string name="type.amenity">Kistawishi</string>
|
||||
<string name="type.amenity.arts_centre">Kituo cha sanaa</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Cykelreparationsstation</string>
|
||||
<string name="type.amenity.parking_space">Sehemu ya maegesho</string>
|
||||
<string name="type.amenity.parking_space.permissive">Sehemu ya maegesho</string>
|
||||
<string name="type.amenity.parking_space.private">Sehemu ya maegesho</string>
|
||||
|
@ -233,6 +234,7 @@
|
|||
<string name="type.recycling.batteries">Betri</string>
|
||||
<string name="type.amenity.vending_machine.public_transport_tickets">Mashine ya kuuzia tiketi za usafiri wa umma</string>
|
||||
<string name="type.boundary.national_park">Hifadhi ya taifa</string>
|
||||
<string name="type.cemetery.grave">Kaburi</string>
|
||||
<string name="type.cuisine.coffee_shop">Kahawa</string>
|
||||
<string name="type.healthcare.laboratory">Maabara ya Matibabu</string>
|
||||
|
||||
|
@ -346,6 +348,7 @@
|
|||
<string name="type.natural.geyser">Chemchem ya maji moto</string>
|
||||
<string name="type.natural.glacier">Mto barafu</string>
|
||||
<string name="type.natural.grassland">Shamba</string>
|
||||
<string name="type.natural.water.lock">Chumba cha kufuli</string>
|
||||
<string name="type.natural.water.reservoir">Hifadhi</string>
|
||||
<string name="type.natural.water.basin">Bonde la Maji</string>
|
||||
<string name="type.natural.scrub">Eneo la Vichaka</string>
|
||||
|
|
|
@ -676,6 +676,7 @@
|
|||
<string name="type.amenity.bench">ม้านั่ง</string>
|
||||
<string name="type.amenity.bicycle_parking">ที่จอดจักรยาน</string>
|
||||
<string name="type.amenity.bicycle_rental">จักรยานให้เช่า</string>
|
||||
<string name="type.amenity.bicycle_repair_station">สถานีซ่อมจักรยาน</string>
|
||||
<string name="type.amenity.biergarten">ลานเบียร์</string>
|
||||
<string name="type.amenity.brothel">ซ่อง</string>
|
||||
<string name="type.amenity.bureau_de_change">แลกเปลี่ยนเงินตรา</string>
|
||||
|
@ -789,10 +790,12 @@
|
|||
<string name="type.building.garage">อาคารจอดรถ</string>
|
||||
<string name="type.building.has_parts">อาคาร</string>
|
||||
<string name="type.building.train_station">สถานีรถไฟ</string>
|
||||
<string name="type.cemetery.grave">หลุมฝังศพ</string>
|
||||
<string name="type.craft.brewery">โรงเบียร์</string>
|
||||
<string name="type.craft.carpenter">ช่างไม้</string>
|
||||
<string name="type.craft.electrician">ช่างไฟฟ้า</string>
|
||||
<string name="type.craft.gardener">คนจัดสวน</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">ระบบปรับอากาศ</string>
|
||||
<string name="type.craft.metal_construction">ช่างเหล็ก</string>
|
||||
<string name="type.craft.painter">ช่างทาสี</string>
|
||||
|
@ -1124,6 +1127,7 @@
|
|||
<string name="type.natural.glacier">ธารน้ำแข็ง</string>
|
||||
<string name="type.natural.grassland">ทุ่งหญ้า</string>
|
||||
<string name="type.natural.water.lake">ทะเลสาบ</string>
|
||||
<string name="type.natural.water.lock">ห้องล็อค</string>
|
||||
<string name="type.natural.water.pond">บ่อ</string>
|
||||
<string name="type.natural.water.reservoir">อ่างเก็บน้ำ</string>
|
||||
<string name="type.natural.water.basin">อ่างน้ำ</string>
|
||||
|
|
|
@ -722,6 +722,7 @@
|
|||
<string name="type.amenity.bench">Bank</string>
|
||||
<string name="type.amenity.bicycle_parking">Bisiklet Park Yeri</string>
|
||||
<string name="type.amenity.bicycle_rental">Bisiklet Kiralama</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Bisiklet tamir istasyonu</string>
|
||||
<string name="type.amenity.biergarten">Bira Bahçesi</string>
|
||||
<string name="type.amenity.brothel">Genelev</string>
|
||||
<string name="type.amenity.bureau_de_change">Döviz Bürosu</string>
|
||||
|
@ -877,11 +878,13 @@
|
|||
<string name="type.building.has_parts">Bina</string>
|
||||
<string name="type.building.train_station">Tren İstasyonu</string>
|
||||
<string name="type.building.warehouse">Depo</string>
|
||||
<string name="type.cemetery.grave">Mezar</string>
|
||||
<string name="type.craft">Zanaat</string>
|
||||
<string name="type.craft.brewery">Bira Fabrikası</string>
|
||||
<string name="type.craft.carpenter">Marangoz</string>
|
||||
<string name="type.craft.electrician">Elektrikçi</string>
|
||||
<string name="type.craft.gardener">Bahçe Düzenleyici</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Klimacı</string>
|
||||
<string name="type.craft.metal_construction">Dökümcü</string>
|
||||
<string name="type.craft.painter">Boyacı</string>
|
||||
|
@ -1285,6 +1288,7 @@
|
|||
<string name="type.natural.heath">Çalı</string>
|
||||
<string name="type.natural.hot_spring">Kaplıca</string>
|
||||
<string name="type.natural.water.lake">Göl</string>
|
||||
<string name="type.natural.water.lock">Kilit Odası</string>
|
||||
<string name="type.natural.water.pond">Gölet</string>
|
||||
<string name="type.natural.water.reservoir">Rezervuar</string>
|
||||
<string name="type.natural.water.basin">Havza</string>
|
||||
|
@ -1567,7 +1571,6 @@
|
|||
<string name="type.waterway.dock">Rıhtım</string>
|
||||
<string name="type.waterway.drain">Lağım</string>
|
||||
<string name="type.waterway.drain.tunnel">Lağım</string>
|
||||
<string name="type.waterway.lock">Kanal Havuzu</string>
|
||||
<string name="type.waterway.lock_gate">Kilit Kapısı</string>
|
||||
<string name="type.waterway.river">Nehir</string>
|
||||
<string name="type.waterway.river.tunnel">Nehir</string>
|
||||
|
|
|
@ -718,6 +718,7 @@
|
|||
<string name="type.amenity.bench">Лавка</string>
|
||||
<string name="type.amenity.bicycle_parking">Велостоянка</string>
|
||||
<string name="type.amenity.bicycle_rental">Велопрокат</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Станція ремонту велосипедів</string>
|
||||
<string name="type.amenity.biergarten">Пивна під відкритим небом</string>
|
||||
<string name="type.amenity.brothel">Бордель</string>
|
||||
<string name="type.amenity.bureau_de_change">Обмін валют</string>
|
||||
|
@ -874,12 +875,16 @@
|
|||
<string name="type.building.has_parts">Будівля</string>
|
||||
<string name="type.building.train_station">Залізничний вокзал</string>
|
||||
<string name="type.building.warehouse">Склад</string>
|
||||
<string name="type.cemetery.grave">Могила</string>
|
||||
<string name="type.craft">Майстерня</string>
|
||||
<string name="type.craft.brewery">Пивоварня</string>
|
||||
<string name="type.craft.beekeeper">Бджоляр</string>
|
||||
<string name="type.craft.blacksmith">Кузня</string>
|
||||
<string name="type.craft.brewery">Крафтова пивоварня</string>
|
||||
<string name="type.craft.carpenter">Столяр</string>
|
||||
<string name="type.craft.electrician">Електрик</string>
|
||||
<string name="type.craft.gardener">Садівник</string>
|
||||
<string name="type.craft.hvac">Кондиціонери</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Опалення, вентиляція та кондиціювання повітря</string>
|
||||
<string name="type.craft.metal_construction">Металоконструкції</string>
|
||||
<string name="type.craft.painter">Маляр</string>
|
||||
<string name="type.craft.photographer">Фотограф</string>
|
||||
|
@ -1274,7 +1279,9 @@
|
|||
<string name="type.natural.beach.gravel">Гальковий пляж</string>
|
||||
<string name="type.natural.cape">Мис</string>
|
||||
<string name="type.natural.cave_entrance">Печера</string>
|
||||
<string name="type.natural.cliff">Обрив</string>
|
||||
<string name="type.natural.cliff">Урвище</string>
|
||||
<string name="type.natural.earth_bank">Обрив</string>
|
||||
<string name="type.man_made.embankment">Насип</string>
|
||||
<string name="type.natural.coastline">Берегова лiнiя</string>
|
||||
<string name="type.natural.geyser">Гейзер</string>
|
||||
<string name="type.natural.glacier">Льодовик</string>
|
||||
|
@ -1282,6 +1289,7 @@
|
|||
<string name="type.natural.heath">Пустище</string>
|
||||
<string name="type.natural.hot_spring">Горяче джерело</string>
|
||||
<string name="type.natural.water.lake">Озеро</string>
|
||||
<string name="type.natural.water.lock">Замкова камера</string>
|
||||
<string name="type.natural.water.pond">Ставок</string>
|
||||
<string name="type.natural.water.reservoir">Водосховище</string>
|
||||
<string name="type.natural.water.basin">Резервуар</string>
|
||||
|
@ -1564,7 +1572,6 @@
|
|||
<string name="type.waterway.dock">Причал</string>
|
||||
<string name="type.waterway.drain">Водовiдвiд</string>
|
||||
<string name="type.waterway.drain.tunnel">Водовiдвiд</string>
|
||||
<string name="type.waterway.lock">Шлюз</string>
|
||||
<string name="type.waterway.lock_gate">Шлюз</string>
|
||||
<string name="type.waterway.river">Річка</string>
|
||||
<string name="type.waterway.river.tunnel">Річка</string>
|
||||
|
|
|
@ -674,6 +674,7 @@
|
|||
<string name="type.amenity.bench">Xe đạp</string>
|
||||
<string name="type.amenity.bicycle_parking">Chỗ Đậu Xe Đạp</string>
|
||||
<string name="type.amenity.bicycle_rental">Cho thuê xe đạp</string>
|
||||
<string name="type.amenity.bicycle_repair_station">trạm sửa xe đạp</string>
|
||||
<string name="type.amenity.biergarten">Vườn bia</string>
|
||||
<string name="type.amenity.brothel">Giải trí</string>
|
||||
<string name="type.amenity.bureau_de_change">Tỉ giá hiện tại</string>
|
||||
|
@ -786,10 +787,12 @@
|
|||
<string name="type.building.garage">Gara</string>
|
||||
<string name="type.building.has_parts">Tòa nhà</string>
|
||||
<string name="type.building.train_station">Đường tàu hỏa</string>
|
||||
<string name="type.cemetery.grave">Phần mộ</string>
|
||||
<string name="type.craft.brewery">Nhà máy bia</string>
|
||||
<string name="type.craft.carpenter">Thợ mộc</string>
|
||||
<string name="type.craft.electrician">Thợ điện</string>
|
||||
<string name="type.craft.gardener">Người thiết kế và xây dựng cảnh quan</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">Điều hòa nhiệt độ</string>
|
||||
<string name="type.craft.metal_construction">Nhà kim khí</string>
|
||||
<string name="type.craft.painter">Họa sỹ</string>
|
||||
|
@ -1119,6 +1122,7 @@
|
|||
<string name="type.natural.glacier">Sông băng</string>
|
||||
<string name="type.natural.grassland">Cánh đồng</string>
|
||||
<string name="type.natural.water.lake">Hồ</string>
|
||||
<string name="type.natural.water.lock">Khoang khóa</string>
|
||||
<string name="type.natural.water.pond">Ao</string>
|
||||
<string name="type.natural.water.reservoir">Hồ chứa</string>
|
||||
<string name="type.natural.water.basin">Một chậu nước</string>
|
||||
|
|
|
@ -707,6 +707,7 @@
|
|||
<string name="type.amenity.bench">長板凳</string>
|
||||
<string name="type.amenity.bicycle_parking">腳踏車停放區</string>
|
||||
<string name="type.amenity.bicycle_rental">自行車出租</string>
|
||||
<string name="type.amenity.bicycle_repair_station">自行車維修站</string>
|
||||
<string name="type.amenity.biergarten">啤酒花園</string>
|
||||
<string name="type.amenity.brothel">妓院</string>
|
||||
<string name="type.amenity.bureau_de_change">匯率</string>
|
||||
|
@ -821,10 +822,12 @@
|
|||
<string name="type.building.garage">車庫</string>
|
||||
<string name="type.building.has_parts">建築物</string>
|
||||
<string name="type.building.train_station">鐵道</string>
|
||||
<string name="type.cemetery.grave">墓穴</string>
|
||||
<string name="type.craft.brewery">釀酒廠</string>
|
||||
<string name="type.craft.carpenter">木工</string>
|
||||
<string name="type.craft.electrician">電工</string>
|
||||
<string name="type.craft.gardener">園藝師</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">空調設備</string>
|
||||
<string name="type.craft.metal_construction">鐵工</string>
|
||||
<string name="type.craft.painter">油漆工</string>
|
||||
|
@ -1164,6 +1167,7 @@
|
|||
<string name="type.natural.glacier">冰川</string>
|
||||
<string name="type.natural.grassland">田野</string>
|
||||
<string name="type.natural.water.lake">湖泊</string>
|
||||
<string name="type.natural.water.lock">鎖室</string>
|
||||
<string name="type.natural.water.pond">潭</string>
|
||||
<string name="type.natural.water.reservoir">水庫</string>
|
||||
<string name="type.natural.water.basin">水庫</string>
|
||||
|
|
|
@ -696,6 +696,7 @@
|
|||
<string name="type.amenity.bench">长凳</string>
|
||||
<string name="type.amenity.bicycle_parking">自行车停车处</string>
|
||||
<string name="type.amenity.bicycle_rental">自行车出租点</string>
|
||||
<string name="type.amenity.bicycle_repair_station">自行车维修站</string>
|
||||
<string name="type.amenity.biergarten">啤酒花园</string>
|
||||
<string name="type.amenity.brothel">妓院</string>
|
||||
<string name="type.amenity.bureau_de_change">货币兑换</string>
|
||||
|
@ -839,11 +840,13 @@
|
|||
<string name="type.building.has_parts">建筑物</string>
|
||||
<string name="type.building.train_station">火车站建筑</string>
|
||||
<string name="type.building.warehouse">仓库</string>
|
||||
<string name="type.cemetery.grave">墓穴</string>
|
||||
<string name="type.craft">工艺作坊</string>
|
||||
<string name="type.craft.brewery">酿酒厂</string>
|
||||
<string name="type.craft.carpenter">木匠</string>
|
||||
<string name="type.craft.electrician">电工</string>
|
||||
<string name="type.craft.gardener">园艺工</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">暖通工程师</string>
|
||||
<string name="type.craft.metal_construction">金属制造工</string>
|
||||
<string name="type.craft.painter">油漆匠</string>
|
||||
|
@ -1232,6 +1235,7 @@
|
|||
<string name="type.natural.heath">荒野</string>
|
||||
<string name="type.natural.hot_spring">温泉</string>
|
||||
<string name="type.natural.water.lake">湖</string>
|
||||
<string name="type.natural.water.lock">锁室</string>
|
||||
<string name="type.natural.water.pond">池塘</string>
|
||||
<string name="type.natural.water.reservoir">水库</string>
|
||||
<string name="type.natural.water.basin">水盆地</string>
|
||||
|
|
|
@ -757,6 +757,7 @@
|
|||
<string name="type.amenity.bench">Bench</string>
|
||||
<string name="type.amenity.bicycle_parking">Bicycle Parking</string>
|
||||
<string name="type.amenity.bicycle_rental">Bicycle Rental</string>
|
||||
<string name="type.amenity.bicycle_repair_station">Bicycle Repair Station</string>
|
||||
<string name="type.amenity.biergarten">Biergarten</string>
|
||||
<string name="type.amenity.brothel">Brothel</string>
|
||||
<string name="type.amenity.bureau_de_change">Currency Exchange</string>
|
||||
|
@ -917,17 +918,26 @@
|
|||
<string name="type.building.has_parts">Building</string>
|
||||
<string name="type.building.train_station">Train Station</string>
|
||||
<string name="type.building.warehouse">Warehouse</string>
|
||||
<string name="type.cemetery.grave">Grave</string>
|
||||
<string name="type.craft">Craft</string>
|
||||
<string name="type.craft.beekeeper">Beekeeper</string>
|
||||
<string name="type.craft.blacksmith">Blacksmith</string>
|
||||
<string name="type.craft.brewery">Craft Brewery</string>
|
||||
<string name="type.craft.carpenter">Carpenter</string>
|
||||
<string name="type.craft.confectionery">Confectionery</string>
|
||||
<string name="type.craft.electrician">Electrician</string>
|
||||
<string name="type.craft.electronics_repair">Electronics Repair</string>
|
||||
<string name="type.craft.gardener">Gardener</string>
|
||||
<string name="type.craft.hvac">Hvac</string>
|
||||
<string name="type.craft.handicraft">Handicraft</string>
|
||||
<!-- Heating, Ventilation, and Air Conditioning -->
|
||||
<string name="type.craft.hvac">HVAC</string>
|
||||
<string name="type.craft.metal_construction">Metal Worker</string>
|
||||
<string name="type.craft.painter">Painter</string>
|
||||
<string name="type.craft.photographer">Photographer</string>
|
||||
<string name="type.craft.plumber">Plumber</string>
|
||||
<string name="type.craft.sawmill">Sawmill</string>
|
||||
<string name="type.craft.shoemaker">Shoe Repair</string>
|
||||
<string name="type.craft.winery">Winery</string>
|
||||
<string name="type.craft.tailor">Tailor</string>
|
||||
<string name="type.cuisine.african">African</string>
|
||||
<string name="type.cuisine.american">American</string>
|
||||
|
@ -1338,6 +1348,8 @@
|
|||
<string name="type.natural.cape">Cape</string>
|
||||
<string name="type.natural.cave_entrance">Cave</string>
|
||||
<string name="type.natural.cliff">Cliff</string>
|
||||
<string name="type.natural.earth_bank">Earth Bank</string>
|
||||
<string name="type.man_made.embankment">Embankment</string>
|
||||
<string name="type.natural.coastline">Coastline</string>
|
||||
<string name="type.natural.geyser">Geyser</string>
|
||||
<string name="type.natural.glacier">Glacier</string>
|
||||
|
@ -1345,6 +1357,7 @@
|
|||
<string name="type.natural.heath">Heath</string>
|
||||
<string name="type.natural.hot_spring">Hot Spring</string>
|
||||
<string name="type.natural.water.lake">Lake</string>
|
||||
<string name="type.natural.water.lock">Lock Chamber</string>
|
||||
<string name="type.natural.water.pond">Pond</string>
|
||||
<string name="type.natural.water.reservoir">Reservoir</string>
|
||||
<string name="type.natural.water.basin">Basin</string>
|
||||
|
@ -1634,7 +1647,6 @@
|
|||
<string name="type.waterway.dock">Waterway Dock</string>
|
||||
<string name="type.waterway.drain">Drain</string>
|
||||
<string name="type.waterway.drain.tunnel">Drain</string>
|
||||
<string name="type.waterway.lock">Waterway Lock</string>
|
||||
<string name="type.waterway.lock_gate">Lock Gate</string>
|
||||
<string name="type.waterway.river">River</string>
|
||||
<string name="type.waterway.river.tunnel">River</string>
|
||||
|
|
|
@ -33,15 +33,13 @@ import com.mapswithme.util.StringUtils;
|
|||
import com.mapswithme.util.UiUtils;
|
||||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SuppressLint("StringFormatMatches")
|
||||
public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity implements AlertDialogCallback
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.DOWNLOADER);
|
||||
private static final String TAG = DownloadResourcesLegacyActivity.class.getName();
|
||||
private static final String TAG = DownloadResourcesLegacyActivity.class.getSimpleName();
|
||||
|
||||
private static final String ERROR_LOADING_DIALOG_TAG = "error_loading_dialog";
|
||||
private static final int ERROR_LOADING_DIALOG_REQ_CODE = 234;
|
||||
|
@ -441,7 +439,7 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity imp
|
|||
return null;
|
||||
|
||||
String msg = "Incoming intent uri: " + intent;
|
||||
LOGGER.i(TAG, msg);
|
||||
Logger.i(TAG, msg);
|
||||
CrashlyticsUtils.INSTANCE.log(Log.INFO, TAG, msg);
|
||||
|
||||
MapTask mapTaskToForward;
|
||||
|
|
|
@ -7,8 +7,6 @@ import androidx.annotation.MainThread;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.Size;
|
||||
import androidx.annotation.UiThread;
|
||||
|
||||
import com.mapswithme.maps.api.ParsedRoutingData;
|
||||
import com.mapswithme.maps.api.ParsedSearchRequest;
|
||||
import com.mapswithme.maps.api.ParsingResult;
|
||||
|
@ -22,8 +20,6 @@ import com.mapswithme.maps.routing.TransitRouteInfo;
|
|||
import com.mapswithme.maps.settings.SettingsPrefsFragment;
|
||||
import com.mapswithme.maps.widget.placepage.PlacePageData;
|
||||
import com.mapswithme.util.Constants;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
@ -34,9 +30,6 @@ import java.lang.annotation.RetentionPolicy;
|
|||
*/
|
||||
public class Framework
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = Framework.class.getSimpleName();
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({MAP_STYLE_CLEAR, MAP_STYLE_DARK, MAP_STYLE_VEHICLE_CLEAR, MAP_STYLE_VEHICLE_DARK})
|
||||
|
||||
|
|
|
@ -16,23 +16,18 @@ import android.view.ViewGroup;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import com.mapswithme.maps.base.BaseMwmFragment;
|
||||
import com.mapswithme.maps.location.LocationHelper;
|
||||
import com.mapswithme.util.Config;
|
||||
import com.mapswithme.util.Counters;
|
||||
import com.mapswithme.util.PermissionsUtils;
|
||||
import com.mapswithme.util.UiUtils;
|
||||
import com.mapswithme.util.concurrency.UiThread;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
public class MapFragment extends BaseMwmFragment
|
||||
implements View.OnTouchListener,
|
||||
SurfaceHolder.Callback
|
||||
{
|
||||
public static final String ARG_LAUNCH_BY_DEEP_LINK = "launch_by_deep_link";
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = MapFragment.class.getSimpleName();
|
||||
|
||||
// Should correspond to android::MultiTouchAction from Framework.cpp
|
||||
|
@ -160,11 +155,11 @@ public class MapFragment extends BaseMwmFragment
|
|||
{
|
||||
if (isThemeChangingProcess())
|
||||
{
|
||||
LOGGER.d(TAG, "Activity is being recreated due theme changing, skip 'surfaceCreated' callback");
|
||||
Logger.d(TAG, "Activity is being recreated due theme changing, skip 'surfaceCreated' callback");
|
||||
return;
|
||||
}
|
||||
|
||||
LOGGER.d(TAG, "surfaceCreated, mSurfaceCreated = " + mSurfaceCreated);
|
||||
Logger.d(TAG, "surfaceCreated, mSurfaceCreated = " + mSurfaceCreated);
|
||||
final Surface surface = surfaceHolder.getSurface();
|
||||
if (nativeIsEngineCreated())
|
||||
{
|
||||
|
@ -220,11 +215,11 @@ public class MapFragment extends BaseMwmFragment
|
|||
{
|
||||
if (isThemeChangingProcess())
|
||||
{
|
||||
LOGGER.d(TAG, "Activity is being recreated due theme changing, skip 'surfaceChanged' callback");
|
||||
Logger.d(TAG, "Activity is being recreated due theme changing, skip 'surfaceChanged' callback");
|
||||
return;
|
||||
}
|
||||
|
||||
LOGGER.d(TAG, "surfaceChanged, mSurfaceCreated = " + mSurfaceCreated);
|
||||
Logger.d(TAG, "surfaceChanged, mSurfaceCreated = " + mSurfaceCreated);
|
||||
if (!mSurfaceCreated || (!mRequireResize && surfaceHolder.isCreating()))
|
||||
return;
|
||||
|
||||
|
@ -241,13 +236,13 @@ public class MapFragment extends BaseMwmFragment
|
|||
@Override
|
||||
public void surfaceDestroyed(SurfaceHolder surfaceHolder)
|
||||
{
|
||||
LOGGER.d(TAG, "surfaceDestroyed");
|
||||
Logger.d(TAG, "surfaceDestroyed");
|
||||
destroySurface();
|
||||
}
|
||||
|
||||
void destroySurface()
|
||||
{
|
||||
LOGGER.d(TAG, "destroySurface, mSurfaceCreated = " + mSurfaceCreated +
|
||||
Logger.d(TAG, "destroySurface, mSurfaceCreated = " + mSurfaceCreated +
|
||||
", mSurfaceAttached = " + mSurfaceAttached + ", isAdded = " + isAdded());
|
||||
if (!mSurfaceCreated || !mSurfaceAttached || !isAdded())
|
||||
return;
|
||||
|
@ -288,14 +283,14 @@ public class MapFragment extends BaseMwmFragment
|
|||
{
|
||||
super.onStart();
|
||||
nativeSetRenderingInitializationFinishedListener(mMapRenderingListener);
|
||||
LOGGER.d(TAG, "onStart");
|
||||
Logger.d(TAG, "onStart");
|
||||
}
|
||||
|
||||
public void onStop()
|
||||
{
|
||||
super.onStop();
|
||||
nativeSetRenderingInitializationFinishedListener(null);
|
||||
LOGGER.d(TAG, "onStop");
|
||||
Logger.d(TAG, "onStop");
|
||||
}
|
||||
|
||||
private boolean isThemeChangingProcess()
|
||||
|
|
|
@ -26,7 +26,6 @@ import androidx.appcompat.widget.Toolbar;
|
|||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.mapswithme.maps.Framework.PlacePageActivationListener;
|
||||
import com.mapswithme.maps.api.ParsedMwmRequest;
|
||||
import com.mapswithme.maps.background.AppBackgroundTracker;
|
||||
|
@ -78,7 +77,6 @@ import com.mapswithme.maps.search.SearchFragment;
|
|||
import com.mapswithme.maps.settings.DrivingOptionsActivity;
|
||||
import com.mapswithme.maps.settings.RoadType;
|
||||
import com.mapswithme.maps.settings.SettingsActivity;
|
||||
import com.mapswithme.maps.settings.StoragePathManager;
|
||||
import com.mapswithme.maps.settings.UnitLocale;
|
||||
import com.mapswithme.maps.sound.TtsPlayer;
|
||||
import com.mapswithme.maps.widget.menu.MainMenu;
|
||||
|
@ -97,8 +95,6 @@ import com.mapswithme.util.UiUtils;
|
|||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.bottomsheet.MenuBottomSheetFragment;
|
||||
import com.mapswithme.util.bottomsheet.MenuBottomSheetItem;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
@ -124,14 +120,10 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
NoConnectionListener,
|
||||
MapWidgetOffsetsProvider
|
||||
{
|
||||
private final Logger mLogger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = MwmActivity.class.getSimpleName();
|
||||
|
||||
public static final String EXTRA_TASK = "map_task";
|
||||
public static final String EXTRA_LAUNCH_BY_DEEP_LINK = "launch_by_deep_link";
|
||||
public static final String EXTRA_BACK_URL = "back_url";
|
||||
private static final String EXTRA_CONSUMED = "mwm.extra.intent.processed";
|
||||
private static final String EXTRA_ONBOARDING_TIP = "extra_onboarding_tip";
|
||||
|
||||
private static final String[] DOCKED_FRAGMENTS = { SearchFragment.class.getName(),
|
||||
DownloaderFragment.class.getName(),
|
||||
|
@ -155,18 +147,12 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
@Nullable
|
||||
private MapFragment mMapFragment;
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private View mPositionChooser;
|
||||
|
||||
private RoutingPlanInplaceController mRoutingPlanInplaceController;
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private NavigationController mNavigationController;
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private MainMenu mMainMenu;
|
||||
|
||||
private PanelAnimator mPanelAnimator;
|
||||
|
@ -183,7 +169,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
private MenuBottomSheetFragment mMainMenuBottomSheet;
|
||||
@Nullable
|
||||
private NavigationButtonsAnimationController mNavAnimationController;
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@SuppressWarnings("NotNullFieldNotInitialized")
|
||||
@NonNull
|
||||
private MapLayersController mToggleMapLayerController;
|
||||
|
||||
|
@ -202,10 +188,9 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
private Bundle mSavedForTabletState;
|
||||
@NonNull
|
||||
private final OnClickListener mOnMyPositionClickListener = new CurrentPositionClickListener();
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@SuppressWarnings("NotNullFieldNotInitialized")
|
||||
@NonNull
|
||||
private PlacePageController mPlacePageController;
|
||||
@SuppressWarnings("NullableProblems")
|
||||
|
||||
public interface LeftAnimationTrackListener
|
||||
{
|
||||
|
@ -427,10 +412,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
return;
|
||||
|
||||
if (savedInstanceState == null && RoutingController.get().hasSavedRoute())
|
||||
{
|
||||
addTask(new Factory.RestoreRouteTask());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void initBottomSheets()
|
||||
|
@ -661,12 +643,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
if (interceptBackPress())
|
||||
return true;
|
||||
|
||||
if (removeCurrentFragment(true))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return removeCurrentFragment(true);
|
||||
}
|
||||
|
||||
private void closeAllFloatingPanelsTablet()
|
||||
|
@ -790,7 +767,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState)
|
||||
protected void onSaveInstanceState(@NonNull Bundle outState)
|
||||
{
|
||||
mPlacePageController.onSave(outState);
|
||||
if (!mIsTabletLayout && RoutingController.get().isPlanning())
|
||||
|
@ -1130,14 +1107,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
return false;
|
||||
|
||||
if (animate)
|
||||
mPanelAnimator.hide(new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
removeFragmentImmediate(fragment);
|
||||
}
|
||||
});
|
||||
mPanelAnimator.hide(() -> removeFragmentImmediate(fragment));
|
||||
else
|
||||
removeFragmentImmediate(fragment);
|
||||
|
||||
|
@ -1971,47 +1941,13 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
|||
}
|
||||
}
|
||||
|
||||
static abstract class AbstractClickMenuDelegate implements ClickMenuDelegate
|
||||
{
|
||||
@NonNull
|
||||
private final MwmActivity mActivity;
|
||||
@NonNull
|
||||
private final MainMenu.Item mItem;
|
||||
|
||||
AbstractClickMenuDelegate(@NonNull MwmActivity activity, @NonNull MainMenu.Item item)
|
||||
{
|
||||
mActivity = activity;
|
||||
mItem = item;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public MwmActivity getActivity()
|
||||
{
|
||||
return mActivity;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public MainMenu.Item getItem()
|
||||
{
|
||||
return mItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void onMenuItemClick()
|
||||
{
|
||||
onMenuItemClickInternal();
|
||||
}
|
||||
|
||||
abstract void onMenuItemClickInternal();
|
||||
}
|
||||
|
||||
private class ToolbarLayoutChangeListener implements ViewTreeObserver.OnGlobalLayoutListener
|
||||
{
|
||||
@Override
|
||||
public void onGlobalLayout()
|
||||
{
|
||||
mSearchController.getToolbar().getViewTreeObserver()
|
||||
.removeGlobalOnLayoutListener(this);
|
||||
.removeOnGlobalLayoutListener(this);
|
||||
|
||||
adjustCompassAndTraffic(UiUtils.isVisible(mSearchController.getToolbar())
|
||||
? calcFloatingViewsOffset()
|
||||
|
|
|
@ -7,8 +7,6 @@ import android.os.Handler;
|
|||
import android.os.Message;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.multidex.MultiDex;
|
||||
|
||||
import com.mapswithme.maps.background.AppBackgroundTracker;
|
||||
import com.mapswithme.maps.background.NotificationChannelFactory;
|
||||
import com.mapswithme.maps.background.NotificationChannelProvider;
|
||||
|
@ -35,7 +33,7 @@ import com.mapswithme.util.StorageUtils;
|
|||
import com.mapswithme.util.ThemeSwitcher;
|
||||
import com.mapswithme.util.UiUtils;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
import com.mapswithme.util.log.LogsManager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
@ -44,8 +42,7 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
|
|||
{
|
||||
@SuppressWarnings("NotNullFieldNotInitialized")
|
||||
@NonNull
|
||||
private Logger mLogger;
|
||||
public final static String TAG = "MwmApplication";
|
||||
private static final String TAG = MwmApplication.class.getSimpleName();
|
||||
|
||||
private AppBackgroundTracker mBackgroundTracker;
|
||||
@SuppressWarnings("NotNullFieldNotInitialized")
|
||||
|
@ -63,10 +60,7 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
|
|||
private final Object mMainQueueToken = new Object();
|
||||
@NonNull
|
||||
private final MapManager.StorageCallback mStorageCallbacks = new StorageCallbackImpl();
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
private MediaPlayerWrapper mPlayer;
|
||||
private boolean mFirstLaunch;
|
||||
|
||||
@NonNull
|
||||
public SubwayManager getSubwayManager()
|
||||
|
@ -100,38 +94,24 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
|
|||
@NonNull
|
||||
public static SharedPreferences prefs(@NonNull Context context)
|
||||
{
|
||||
String prefFile = context.getString(R.string.pref_file_name);
|
||||
return context.getSharedPreferences(prefFile, MODE_PRIVATE);
|
||||
return context.getSharedPreferences(context.getString(R.string.pref_file_name), MODE_PRIVATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base)
|
||||
{
|
||||
super.attachBaseContext(base);
|
||||
MultiDex.install(this);
|
||||
}
|
||||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
@Override
|
||||
public void onCreate()
|
||||
{
|
||||
super.onCreate();
|
||||
LoggerFactory.INSTANCE.initialize(this);
|
||||
mLogger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
getLogger().d(TAG, "Application is created");
|
||||
Logger.i(TAG, "Initializing application");
|
||||
LogsManager.INSTANCE.initFileLogging(this);
|
||||
|
||||
// Set configuration directory as early as possible.
|
||||
// Other methods may explicitly use Config, which requires settingsDir to be set.
|
||||
final String settingsPath = StorageUtils.getSettingsPath(this);
|
||||
getLogger().d(TAG, "Settings path = " + settingsPath);
|
||||
try
|
||||
{
|
||||
StorageUtils.createDirectory(settingsPath);
|
||||
nativeSetSettingsDir(settingsPath);
|
||||
} catch (IOException e)
|
||||
{
|
||||
// We have nothing to do here.
|
||||
if (!StorageUtils.createDirectory(settingsPath))
|
||||
throw new AssertionError("Can't create settingsDir " + settingsPath);
|
||||
}
|
||||
Logger.d(TAG, "Settings path = " + settingsPath);
|
||||
nativeSetSettingsDir(settingsPath);
|
||||
|
||||
mMainLoopHandler = new Handler(getMainLooper());
|
||||
ConnectionState.INSTANCE.initialize(this);
|
||||
CrashlyticsUtils.INSTANCE.initialize(this);
|
||||
|
@ -168,16 +148,15 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
|
|||
if (mPlatformInitialized)
|
||||
return;
|
||||
|
||||
final Logger log = getLogger();
|
||||
final String apkPath = StorageUtils.getApkPath(this);
|
||||
log.d(TAG, "Apk path = " + apkPath);
|
||||
Logger.d(TAG, "Apk path = " + apkPath);
|
||||
// Note: StoragePathManager uses Config, which requires initConfig() to be called.
|
||||
final String writablePath = StoragePathManager.findMapsStorage(this);
|
||||
log.d(TAG, "Writable path = " + writablePath);
|
||||
Logger.d(TAG, "Writable path = " + writablePath);
|
||||
final String privatePath = StorageUtils.getPrivatePath(this);
|
||||
log.d(TAG, "Private path = " + privatePath);
|
||||
Logger.d(TAG, "Private path = " + privatePath);
|
||||
final String tempPath = StorageUtils.getTempPath(this);
|
||||
log.d(TAG, "Temp path = " + tempPath);
|
||||
Logger.d(TAG, "Temp path = " + tempPath);
|
||||
|
||||
// If platform directories are not created it means that native part of app will not be able
|
||||
// to work at all. So, we just ignore native part initialization in this case, e.g. when the
|
||||
|
@ -195,7 +174,7 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
|
|||
|
||||
Editor.init(this);
|
||||
mPlatformInitialized = true;
|
||||
log.i(TAG, "Platform initialized");
|
||||
Logger.i(TAG, "Platform initialized");
|
||||
}
|
||||
|
||||
private void createPlatformDirectories(@NonNull String writablePath,
|
||||
|
@ -204,9 +183,9 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
|
|||
{
|
||||
SharedPropertiesUtils.emulateBadExternalStorage(this);
|
||||
|
||||
StorageUtils.createDirectory(writablePath);
|
||||
StorageUtils.createDirectory(privatePath);
|
||||
StorageUtils.createDirectory(tempPath);
|
||||
StorageUtils.requireDirectory(writablePath);
|
||||
StorageUtils.requireDirectory(privatePath);
|
||||
StorageUtils.requireDirectory(tempPath);
|
||||
}
|
||||
|
||||
private void initNativeFramework()
|
||||
|
@ -231,7 +210,7 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
|
|||
IsolinesManager.from(this).initialize(null);
|
||||
mBackgroundTracker.addListener(this);
|
||||
|
||||
getLogger().i(TAG, "Framework initialized");
|
||||
Logger.i(TAG, "Framework initialized");
|
||||
mFrameworkInitialized = true;
|
||||
}
|
||||
|
||||
|
@ -267,17 +246,11 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
|
|||
Counters.resetAppSessionCounters(context);
|
||||
}
|
||||
|
||||
// Called from jni
|
||||
@SuppressWarnings("unused")
|
||||
void forwardToMainThread(final long taskPointer)
|
||||
{
|
||||
Message m = Message.obtain(mMainLoopHandler, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
nativeProcessTask(taskPointer);
|
||||
}
|
||||
});
|
||||
Message m = Message.obtain(mMainLoopHandler, () -> nativeProcessTask(taskPointer));
|
||||
m.obj = mMainQueueToken;
|
||||
mMainLoopHandler.sendMessage(m);
|
||||
}
|
||||
|
@ -297,17 +270,6 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
|
|||
private static native void nativeAddLocalization(String name, String value);
|
||||
private static native void nativeOnTransit(boolean foreground);
|
||||
|
||||
@NonNull
|
||||
public Logger getLogger()
|
||||
{
|
||||
return mLogger;
|
||||
}
|
||||
|
||||
public boolean isFirstLaunch()
|
||||
{
|
||||
return mFirstLaunch;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransit(boolean foreground)
|
||||
{
|
||||
|
|
|
@ -6,14 +6,12 @@ import android.content.Intent;
|
|||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mapswithme.util.CrashlyticsUtils;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
public abstract class MwmBroadcastReceiver extends BroadcastReceiver
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = MwmBroadcastReceiver.class.getSimpleName();
|
||||
|
||||
@NonNull
|
||||
protected String getTag()
|
||||
|
@ -28,11 +26,11 @@ public abstract class MwmBroadcastReceiver extends BroadcastReceiver
|
|||
{
|
||||
MwmApplication app = MwmApplication.from(context);
|
||||
String msg = "onReceive: " + intent;
|
||||
LOGGER.i(getTag(), msg);
|
||||
Logger.i(TAG, msg);
|
||||
CrashlyticsUtils.INSTANCE.log(Log.INFO, getTag(), msg);
|
||||
if (!app.arePlatformAndCoreInitialized())
|
||||
{
|
||||
LOGGER.w(getTag(), "Application is not initialized, ignoring " + intent);
|
||||
Logger.w(TAG, "Application is not initialized, ignoring " + intent);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,14 +5,12 @@ import android.util.Log;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.JobIntentService;
|
||||
|
||||
import com.mapswithme.util.CrashlyticsUtils;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
public abstract class MwmJobIntentService extends JobIntentService
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = MwmJobIntentService.class.getSimpleName();
|
||||
|
||||
@NonNull
|
||||
protected String getTag()
|
||||
|
@ -27,11 +25,11 @@ public abstract class MwmJobIntentService extends JobIntentService
|
|||
{
|
||||
MwmApplication app = MwmApplication.from(this);
|
||||
String msg = "onHandleWork: " + intent;
|
||||
LOGGER.i(getTag(), msg);
|
||||
Logger.i(TAG, msg);
|
||||
CrashlyticsUtils.INSTANCE.log(Log.INFO, getTag(), msg);
|
||||
if (!app.arePlatformAndCoreInitialized())
|
||||
{
|
||||
LOGGER.w(getTag(), "Application is not initialized, ignoring " + intent);
|
||||
Logger.w(TAG, "Application is not initialized, ignoring " + intent);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,12 +7,10 @@ import android.os.Bundle;
|
|||
import android.util.SparseArray;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
import com.mapswithme.util.Listeners;
|
||||
import com.mapswithme.util.concurrency.UiThread;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
|
@ -22,7 +20,6 @@ import java.lang.ref.WeakReference;
|
|||
*/
|
||||
public final class AppBackgroundTracker
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = AppBackgroundTracker.class.getSimpleName();
|
||||
private static final int TRANSITION_DELAY_MS = 1000;
|
||||
|
||||
|
@ -67,7 +64,7 @@ public final class AppBackgroundTracker
|
|||
@Override
|
||||
public void onActivityStarted(Activity activity)
|
||||
{
|
||||
LOGGER.d(TAG, "onActivityStarted activity = " + activity);
|
||||
Logger.d(TAG, "onActivityStarted activity = " + activity);
|
||||
if (mActivities.size() == 0)
|
||||
notifyVisibleAppLaunchListeners();
|
||||
mActivities.put(activity.hashCode(), new WeakReference<>(activity));
|
||||
|
@ -77,7 +74,7 @@ public final class AppBackgroundTracker
|
|||
@Override
|
||||
public void onActivityStopped(Activity activity)
|
||||
{
|
||||
LOGGER.d(TAG, "onActivityStopped activity = " + activity);
|
||||
Logger.d(TAG, "onActivityStopped activity = " + activity);
|
||||
mActivities.remove(activity.hashCode());
|
||||
onActivityChanged();
|
||||
}
|
||||
|
@ -85,31 +82,31 @@ public final class AppBackgroundTracker
|
|||
@Override
|
||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState)
|
||||
{
|
||||
LOGGER.d(TAG, "onActivityCreated activity = " + activity);
|
||||
Logger.d(TAG, "onActivityCreated activity = " + activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(Activity activity)
|
||||
{
|
||||
LOGGER.d(TAG, "onActivityDestroyed activity = " + activity);
|
||||
Logger.d(TAG, "onActivityDestroyed activity = " + activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity)
|
||||
{
|
||||
LOGGER.d(TAG, "onActivityResumed activity = " + activity);
|
||||
Logger.d(TAG, "onActivityResumed activity = " + activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity)
|
||||
{
|
||||
LOGGER.d(TAG, "onActivityPaused activity = " + activity);
|
||||
Logger.d(TAG, "onActivityPaused activity = " + activity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle outState)
|
||||
{
|
||||
LOGGER.d(TAG, "onActivitySaveInstanceState activity = " + activity);
|
||||
Logger.d(TAG, "onActivitySaveInstanceState activity = " + activity);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -6,18 +6,14 @@ import android.util.Log;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mapswithme.util.Config;
|
||||
import com.mapswithme.util.CrashlyticsUtils;
|
||||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.ViewServer;
|
||||
import com.mapswithme.util.concurrency.UiThread;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
public class BaseActivityDelegate
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = BaseActivityDelegate.class.getSimpleName();
|
||||
@NonNull
|
||||
private final BaseActivity mActivity;
|
||||
|
@ -55,13 +51,11 @@ public class BaseActivityDelegate
|
|||
public void onDestroy()
|
||||
{
|
||||
logLifecycleMethod("onDestroy()");
|
||||
ViewServer.get(mActivity.get()).removeWindow(mActivity.get());
|
||||
}
|
||||
|
||||
public void onPostCreate()
|
||||
{
|
||||
logLifecycleMethod("onPostCreate()");
|
||||
ViewServer.get(mActivity.get()).addWindow(mActivity.get());
|
||||
}
|
||||
|
||||
public void onStart()
|
||||
|
@ -77,7 +71,6 @@ public class BaseActivityDelegate
|
|||
public void onResume()
|
||||
{
|
||||
logLifecycleMethod("onResume()");
|
||||
ViewServer.get(mActivity.get()).setFocusedWindow(mActivity.get());
|
||||
Utils.showOnLockScreen(Config.isShowOnLockScreenEnabled(), mActivity.get());
|
||||
}
|
||||
|
||||
|
@ -101,6 +94,6 @@ public class BaseActivityDelegate
|
|||
{
|
||||
String msg = mActivity.getClass().getSimpleName() + ": " + method + " activity: " + mActivity;
|
||||
CrashlyticsUtils.INSTANCE.log(Log.INFO, TAG, msg);
|
||||
LOGGER.i(TAG, msg);
|
||||
Logger.i(TAG, msg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ import androidx.appcompat.app.AppCompatActivity;
|
|||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.SplashActivity;
|
||||
|
@ -26,11 +25,12 @@ import com.mapswithme.util.ThemeUtils;
|
|||
import com.mapswithme.util.UiUtils;
|
||||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
public abstract class BaseMwmFragmentActivity extends AppCompatActivity
|
||||
implements BaseActivity
|
||||
{
|
||||
private static final String TAG = BaseMwmFragmentActivity.class.getSimpleName();
|
||||
|
||||
private final BaseActivityDelegate mBaseDelegate = new BaseActivityDelegate(this);
|
||||
private boolean mSafeCreated;
|
||||
|
||||
|
@ -280,9 +280,7 @@ public abstract class BaseMwmFragmentActivity extends AppCompatActivity
|
|||
}
|
||||
catch (ClassCastException e)
|
||||
{
|
||||
Logger logger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
String tag = this.getClass().getSimpleName();
|
||||
logger.i(tag, "Fragment '" + currentFragment + "' doesn't handle back press by itself.");
|
||||
Logger.i(TAG, "Fragment '" + currentFragment + "' doesn't handle back press by itself.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,18 +8,14 @@ import android.content.Intent;
|
|||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.DocumentsContract;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.LayoutRes;
|
||||
import androidx.annotation.MenuRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.adapter.OnItemClickListener;
|
||||
|
@ -32,13 +28,12 @@ import com.mapswithme.maps.dialog.DialogUtils;
|
|||
import com.mapswithme.maps.dialog.EditTextDialogFragment;
|
||||
import com.mapswithme.maps.widget.PlaceholderView;
|
||||
import com.mapswithme.maps.widget.recycler.ItemDecoratorFactory;
|
||||
import com.mapswithme.util.bottomsheet.MenuBottomSheetFragment;
|
||||
import com.mapswithme.util.StorageUtils;
|
||||
import com.mapswithme.util.bottomsheet.MenuBottomSheetFragment;
|
||||
import com.mapswithme.util.bottomsheet.MenuBottomSheetItem;
|
||||
import com.mapswithme.util.concurrency.ThreadPool;
|
||||
import com.mapswithme.util.concurrency.UiThread;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
@ -47,20 +42,19 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
|
||||
public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment<BookmarkCategoriesAdapter>
|
||||
implements BookmarkManager.BookmarksLoadingListener,
|
||||
CategoryListCallback,
|
||||
OnItemClickListener<BookmarkCategory>,
|
||||
OnItemMoreClickListener<BookmarkCategory>,
|
||||
OnItemLongClickListener<BookmarkCategory>, BookmarkManager.BookmarksSharingListener
|
||||
CategoryListCallback,
|
||||
OnItemClickListener<BookmarkCategory>,
|
||||
OnItemMoreClickListener<BookmarkCategory>,
|
||||
OnItemLongClickListener<BookmarkCategory>, BookmarkManager.BookmarksSharingListener
|
||||
|
||||
{
|
||||
private static final String TAG = BookmarkCategoriesFragment.class.getSimpleName();
|
||||
|
||||
static final int REQ_CODE_DELETE_CATEGORY = 102;
|
||||
static final int REQ_CODE_IMPORT_DIRECTORY = 103;
|
||||
|
||||
private static final int MAX_CATEGORY_NAME_LENGTH = 60;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = BookmarkCategoriesFragment.class.getSimpleName();
|
||||
|
||||
@Nullable
|
||||
private BookmarkCategory mSelectedCategory;
|
||||
@Nullable
|
||||
|
@ -286,7 +280,7 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment<Bookmark
|
|||
final Uri rootUri = data.getData();
|
||||
final ProgressDialog dialog = DialogUtils.createModalProgressDialog(context, R.string.wait_several_minutes);
|
||||
dialog.show();
|
||||
LOGGER.d(TAG, "Importing bookmarks from " + rootUri);
|
||||
Logger.d(TAG, "Importing bookmarks from " + rootUri);
|
||||
MwmApplication app = MwmApplication.from(context);
|
||||
final File tempDir = new File(StorageUtils.getTempPath(app));
|
||||
final ContentResolver resolver = context.getContentResolver();
|
||||
|
|
|
@ -5,20 +5,17 @@ import android.app.ProgressDialog;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
|
||||
import com.mapswithme.maps.bookmarks.data.BookmarkSharingResult;
|
||||
import com.mapswithme.maps.dialog.DialogUtils;
|
||||
import com.mapswithme.util.SharingUtils;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
public enum BookmarksSharingHelper
|
||||
{
|
||||
INSTANCE;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = BookmarksSharingHelper.class.getSimpleName();
|
||||
|
||||
@Nullable
|
||||
|
@ -51,8 +48,7 @@ public enum BookmarksSharingHelper
|
|||
DialogUtils.showAlertDialog(context, R.string.dialog_routing_system_error,
|
||||
R.string.bookmarks_error_message_share_general);
|
||||
String catName = BookmarkManager.INSTANCE.getCategoryById(result.getCategoryId()).getName();
|
||||
LOGGER.e(TAG, "Failed to share bookmark category '" + catName + "', error code: "
|
||||
+ result.getCode());
|
||||
Logger.e(TAG, "Failed to share bookmark category '" + catName + "', error code: " + result.getCode());
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError("Unsupported bookmark sharing code: " + result.getCode());
|
||||
|
|
|
@ -11,7 +11,6 @@ import androidx.annotation.MainThread;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.WorkerThread;
|
||||
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.base.DataChangedListener;
|
||||
import com.mapswithme.maps.base.Observable;
|
||||
|
@ -20,7 +19,6 @@ import com.mapswithme.util.StorageUtils;
|
|||
import com.mapswithme.util.UTM;
|
||||
import com.mapswithme.util.concurrency.UiThread;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -77,7 +75,6 @@ public enum BookmarkManager
|
|||
|
||||
static String[] BOOKMARKS_EXTENSIONS = Framework.nativeGetBookmarksFilesExts();
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = BookmarkManager.class.getSimpleName();
|
||||
|
||||
@NonNull
|
||||
|
@ -412,7 +409,7 @@ public enum BookmarkManager
|
|||
@MainThread
|
||||
public void loadBookmarksFile(@NonNull String path, boolean isTemporaryFile)
|
||||
{
|
||||
LOGGER.d(TAG, "Loading bookmarks file from: " + path);
|
||||
Logger.d(TAG, "Loading bookmarks file from: " + path);
|
||||
nativeLoadBookmarksFile(path, isTemporaryFile);
|
||||
}
|
||||
|
||||
|
@ -474,18 +471,18 @@ public enum BookmarkManager
|
|||
String filename = getBookmarksFilenameFromUri(resolver, uri);
|
||||
if (filename == null)
|
||||
{
|
||||
LOGGER.w(TAG, "Missing path in bookmarks URI: " + uri);
|
||||
Logger.w(TAG, "Missing path in bookmarks URI: " + uri);
|
||||
return false;
|
||||
}
|
||||
|
||||
LOGGER.w(TAG, "Downloading bookmarks file " + uri);
|
||||
Logger.w(TAG, "Downloading bookmarks file " + uri);
|
||||
File tempFile = new File(tempDir, filename);
|
||||
try
|
||||
{
|
||||
StorageUtils.copyFile(resolver, uri, tempFile);
|
||||
} catch (IOException e)
|
||||
{
|
||||
LOGGER.w(TAG, "Failed to download bookmarks file from " + uri, e);
|
||||
Logger.w(TAG, "Failed to download bookmarks file from " + uri, e);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -865,9 +862,9 @@ public enum BookmarkManager
|
|||
@SortingType
|
||||
private native int[] nativeGetAvailableSortingTypes(long catId, boolean hasMyPosition);
|
||||
|
||||
private native boolean nativeGetSortedCategory(long catId, @SortingType int sortingType,
|
||||
boolean hasMyPosition, double lat, double lon,
|
||||
long timestamp);
|
||||
private native void nativeGetSortedCategory(long catId, @SortingType int sortingType,
|
||||
boolean hasMyPosition, double lat, double lon,
|
||||
long timestamp);
|
||||
|
||||
@NonNull
|
||||
private static native String nativeGetBookmarkName(@IntRange(from = 0) long bookmarkId);
|
||||
|
|
|
@ -19,15 +19,15 @@ import androidx.fragment.app.Fragment;
|
|||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.base.BaseMwmDialogFragment;
|
||||
import com.mapswithme.util.UiUtils;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
public class AlertDialog extends BaseMwmDialogFragment
|
||||
{
|
||||
private static final String TAG = AlertDialog.class.getSimpleName();
|
||||
|
||||
private static final String ARG_TITLE_ID = "arg_title_id";
|
||||
private static final String ARG_MESSAGE_ID = "arg_message_id";
|
||||
private static final String ARG_POSITIVE_BUTTON_ID = "arg_positive_button_id";
|
||||
|
@ -94,9 +94,7 @@ public class AlertDialog extends BaseMwmDialogFragment
|
|||
}
|
||||
catch (ClassCastException e)
|
||||
{
|
||||
Logger logger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
logger.w(AlertDialog.class.getSimpleName(),
|
||||
"Caller doesn't implement AlertDialogCallback interface.");
|
||||
Logger.w(TAG, "Caller doesn't implement AlertDialogCallback interface.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,9 @@ import android.os.AsyncTask;
|
|||
import android.util.Base64;
|
||||
|
||||
import com.mapswithme.util.Constants;
|
||||
import com.mapswithme.util.HttpClient;
|
||||
import com.mapswithme.util.StringUtils;
|
||||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
@ -24,8 +22,7 @@ import java.util.concurrent.Executors;
|
|||
@SuppressWarnings("unused")
|
||||
class ChunkTask extends AsyncTask<Void, byte[], Integer>
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.DOWNLOADER);
|
||||
private static final String TAG = "ChunkTask";
|
||||
private static final String TAG = ChunkTask.class.getSimpleName();
|
||||
|
||||
private static final int TIMEOUT_IN_SECONDS = 10;
|
||||
|
||||
|
@ -190,9 +187,9 @@ class ChunkTask extends AsyncTask<Void, byte[], Integer>
|
|||
if ((isChunk && err != HttpURLConnection.HTTP_PARTIAL) || (!isChunk && err != HttpURLConnection.HTTP_OK))
|
||||
{
|
||||
// we've set error code so client should be notified about the error
|
||||
LOGGER.w(TAG, "Error for " + urlConnection.getURL() +
|
||||
": Server replied with code " + err +
|
||||
", aborting download. " + Utils.mapPrettyPrint(requestParams));
|
||||
Logger.w(TAG, "Error for " + urlConnection.getURL() +
|
||||
": Server replied with code " + err +
|
||||
", aborting download. " + Utils.mapPrettyPrint(requestParams));
|
||||
return INCONSISTENT_FILE_SIZE;
|
||||
}
|
||||
|
||||
|
@ -207,9 +204,9 @@ class ChunkTask extends AsyncTask<Void, byte[], Integer>
|
|||
if (contentLength != mExpectedFileSize)
|
||||
{
|
||||
// we've set error code so client should be notified about the error
|
||||
LOGGER.w(TAG, "Error for " + urlConnection.getURL() +
|
||||
": Invalid file size received (" + contentLength + ") while expecting " + mExpectedFileSize +
|
||||
". Aborting download.");
|
||||
Logger.w(TAG, "Error for " + urlConnection.getURL() +
|
||||
": Invalid file size received (" + contentLength + ") while expecting " + mExpectedFileSize +
|
||||
". Aborting download.");
|
||||
return INCONSISTENT_FILE_SIZE;
|
||||
}
|
||||
// @TODO Else display received web page to user - router is redirecting us to some page
|
||||
|
@ -218,11 +215,11 @@ class ChunkTask extends AsyncTask<Void, byte[], Integer>
|
|||
return downloadFromStream(new BufferedInputStream(urlConnection.getInputStream(), 65536));
|
||||
} catch (final MalformedURLException ex)
|
||||
{
|
||||
LOGGER.e(TAG, "Invalid url: " + mUrl, ex);
|
||||
Logger.e(TAG, "Invalid url: " + mUrl, ex);
|
||||
return INVALID_URL;
|
||||
} catch (final IOException ex)
|
||||
{
|
||||
LOGGER.d(TAG, "IOException in doInBackground for URL: " + mUrl, ex);
|
||||
Logger.d(TAG, "IOException in doInBackground for URL: " + mUrl, ex);
|
||||
return IO_EXCEPTION;
|
||||
} finally
|
||||
{
|
||||
|
@ -246,7 +243,7 @@ class ChunkTask extends AsyncTask<Void, byte[], Integer>
|
|||
break;
|
||||
} catch (final IOException ex)
|
||||
{
|
||||
LOGGER.e(TAG, "IOException in downloadFromStream for chunk size: " + size, ex);
|
||||
Logger.e(TAG, "IOException in downloadFromStream for chunk size: " + size, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ public class FaqFragment extends BaseMwmFragment
|
|||
|
||||
private void reportBug()
|
||||
{
|
||||
Utils.sendBugReport(requireActivity(), "Organic Maps Bugreport");
|
||||
Utils.sendBugReport(requireActivity(), "");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -128,7 +128,7 @@ public class HelpFragment extends BaseMwmFragment implements View.OnClickListene
|
|||
else if (id == R.id.faq)
|
||||
((HelpActivity) getActivity()).stackFragment(FaqFragment.class, getString(R.string.faq), null);
|
||||
else if (id == R.id.report)
|
||||
Utils.sendFeedback(getActivity());
|
||||
Utils.sendBugReport(getActivity(), "");
|
||||
else if (id == R.id.support_us)
|
||||
openLink(Constants.Url.SUPPORT_US);
|
||||
else if (id == R.id.rate)
|
||||
|
|
|
@ -2,17 +2,14 @@ package com.mapswithme.maps.intent;
|
|||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Intent;
|
||||
import android.location.Location;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.mapswithme.maps.DownloadResourcesLegacyActivity;
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.MapFragment;
|
||||
|
@ -31,15 +28,10 @@ import com.mapswithme.maps.location.LocationHelper;
|
|||
import com.mapswithme.maps.routing.RoutingController;
|
||||
import com.mapswithme.maps.search.SearchActivity;
|
||||
import com.mapswithme.maps.search.SearchEngine;
|
||||
import com.mapswithme.util.CrashlyticsUtils;
|
||||
import com.mapswithme.util.KeyValue;
|
||||
import com.mapswithme.util.StorageUtils;
|
||||
import com.mapswithme.util.StringUtils;
|
||||
import com.mapswithme.util.UTM;
|
||||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.concurrency.ThreadPool;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
|
|
@ -7,14 +7,14 @@ import android.location.LocationManager;
|
|||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
class AndroidNativeProvider extends BaseLocationProvider
|
||||
{
|
||||
protected String TAG = AndroidNativeProvider.class.getSimpleName();
|
||||
private static final String TAG = AndroidNativeProvider.class.getSimpleName();
|
||||
|
||||
private class NativeLocationListener implements LocationListener {
|
||||
@Override
|
||||
|
@ -26,7 +26,7 @@ class AndroidNativeProvider extends BaseLocationProvider
|
|||
@Override
|
||||
public void onProviderDisabled(@NonNull String provider)
|
||||
{
|
||||
LOGGER.d(TAG, "Disabled location provider: " + provider);
|
||||
Logger.d(TAG, "Disabled location provider: " + provider);
|
||||
mProviderCount--;
|
||||
if (mProviderCount < MIN_PROVIDER_COUNT)
|
||||
mListener.onLocationError(LocationHelper.ERROR_GPS_OFF);
|
||||
|
@ -35,22 +35,22 @@ class AndroidNativeProvider extends BaseLocationProvider
|
|||
@Override
|
||||
public void onProviderEnabled(@NonNull String provider)
|
||||
{
|
||||
LOGGER.d(TAG, "Enabled location provider: " + provider);
|
||||
Logger.d(TAG, "Enabled location provider: " + provider);
|
||||
mProviderCount++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(String provider, int status, Bundle extras)
|
||||
{
|
||||
LOGGER.d(TAG, "Status changed for location provider: " + provider + "; new status = " + status);
|
||||
Logger.d(TAG, "Status changed for location provider: " + provider + "; new status = " + status);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@NonNull
|
||||
private final LocationManager mLocationManager;
|
||||
private int mProviderCount = 0;
|
||||
private boolean mActive = false;
|
||||
static private int MIN_PROVIDER_COUNT = 2; // PASSIVE is always available
|
||||
static private final int MIN_PROVIDER_COUNT = 2; // PASSIVE is always available
|
||||
|
||||
@NonNull
|
||||
final private NativeLocationListener mNativeLocationListener = new NativeLocationListener();
|
||||
|
@ -69,7 +69,7 @@ class AndroidNativeProvider extends BaseLocationProvider
|
|||
@Override
|
||||
public void start(long interval)
|
||||
{
|
||||
LOGGER.d(TAG, "start()");
|
||||
Logger.d(TAG, "start()");
|
||||
if (mActive)
|
||||
throw new IllegalStateException("Already started");
|
||||
mActive = true;
|
||||
|
@ -83,12 +83,12 @@ class AndroidNativeProvider extends BaseLocationProvider
|
|||
|
||||
for (String provider : providers)
|
||||
{
|
||||
LOGGER.d(TAG, "Request Android native provider '" + provider
|
||||
+ "' to get locations at this interval = " + interval + " ms");
|
||||
Logger.d(TAG, "Request Android native provider '" + provider
|
||||
+ "' to get locations at this interval = " + interval + " ms");
|
||||
mLocationManager.requestLocationUpdates(provider, interval, 0, mNativeLocationListener);
|
||||
|
||||
final Location location = mLocationManager.getLastKnownLocation(provider);
|
||||
LOGGER.d(TAG, "provider = '" + provider + "' last location = " + location);
|
||||
Logger.d(TAG, "provider = '" + provider + "' last location = " + location);
|
||||
if (location != null)
|
||||
mListener.onLocationChanged(location);
|
||||
|
||||
|
@ -99,7 +99,7 @@ class AndroidNativeProvider extends BaseLocationProvider
|
|||
@Override
|
||||
public void stop()
|
||||
{
|
||||
LOGGER.d(TAG, "stop()");
|
||||
Logger.d(TAG, "stop()");
|
||||
mLocationManager.removeUpdates(mNativeLocationListener);
|
||||
mActive = false;
|
||||
}
|
||||
|
|
|
@ -4,13 +4,8 @@ import android.location.Location;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
abstract class BaseLocationProvider
|
||||
{
|
||||
static protected final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.LOCATION);
|
||||
|
||||
interface Listener
|
||||
{
|
||||
void onLocationChanged(@NonNull Location location);
|
||||
|
|
|
@ -10,7 +10,6 @@ import android.location.LocationManager;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.UiThread;
|
||||
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
import com.mapswithme.maps.background.AppBackgroundTracker;
|
||||
|
@ -25,7 +24,6 @@ import com.mapswithme.util.NetworkPolicy;
|
|||
import com.mapswithme.util.PermissionsUtils;
|
||||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
public enum LocationHelper implements Initializable<Context>, AppBackgroundTracker.OnTransitionListener, BaseLocationProvider.Listener
|
||||
{
|
||||
|
@ -67,8 +65,7 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
// to play nice zoom animation once a user will leave first screens and will see a map.
|
||||
if (mInFirstRun)
|
||||
{
|
||||
mLogger.d(TAG, "Location update is obtained and must be ignored, " +
|
||||
"because the app is in a first run mode");
|
||||
Logger.d(TAG, "Location update is obtained and must be ignored, because the app is in a first run mode");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -100,8 +97,8 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
@Override
|
||||
public void onLocationError(int errorCode)
|
||||
{
|
||||
mLogger.d(TAG, "onLocationError errorCode = " + errorCode +
|
||||
", current state = " + LocationState.nameOf(getMyPositionMode()));
|
||||
Logger.d(TAG, "onLocationError errorCode = " + errorCode +
|
||||
", current state = " + LocationState.nameOf(getMyPositionMode()));
|
||||
mSavedLocation = null;
|
||||
nativeOnLocationError(errorCode);
|
||||
if (mUiCallback != null)
|
||||
|
@ -115,8 +112,7 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
}
|
||||
};
|
||||
|
||||
private final static String TAG = LocationHelper.class.getSimpleName();
|
||||
private final Logger mLogger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.LOCATION);
|
||||
private static final String TAG = LocationHelper.class.getSimpleName();
|
||||
@NonNull
|
||||
private final Listeners<LocationListener> mListeners = new Listeners<>();
|
||||
@Nullable
|
||||
|
@ -144,10 +140,10 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
public void onMyPositionModeChanged(int newMode)
|
||||
{
|
||||
notifyMyPositionModeChanged(newMode);
|
||||
mLogger.d(TAG, "onMyPositionModeChanged mode = " + LocationState.nameOf(newMode));
|
||||
Logger.d(TAG, "onMyPositionModeChanged mode = " + LocationState.nameOf(newMode));
|
||||
|
||||
if (mUiCallback == null)
|
||||
mLogger.d(TAG, "UI is not ready to listen my position changes, i.e. it's not attached yet.");
|
||||
Logger.d(TAG, "UI is not ready to listen my position changes, i.e. it's not attached yet.");
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -210,7 +206,7 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
|
||||
public void switchToNextMode()
|
||||
{
|
||||
mLogger.d(TAG, "switchToNextMode()");
|
||||
Logger.d(TAG, "switchToNextMode()");
|
||||
LocationState.nativeSwitchToNextMode();
|
||||
}
|
||||
|
||||
|
@ -224,7 +220,7 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
|
||||
public void setStopLocationUpdateByUser(boolean isStopped)
|
||||
{
|
||||
mLogger.d(TAG, "Set stop location update by user: " + isStopped);
|
||||
Logger.d(TAG, "Set stop location update by user: " + isStopped);
|
||||
mLocationUpdateStoppedByUser = isStopped;
|
||||
}
|
||||
|
||||
|
@ -238,7 +234,7 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
{
|
||||
if (foreground)
|
||||
{
|
||||
mLogger.d(TAG, "Resumed in foreground");
|
||||
Logger.d(TAG, "Resumed in foreground");
|
||||
|
||||
if (mReceiverRegistered)
|
||||
{
|
||||
|
@ -250,7 +246,7 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
}
|
||||
else
|
||||
{
|
||||
mLogger.d(TAG, "Stopped in background");
|
||||
Logger.d(TAG, "Stopped in background");
|
||||
|
||||
if (!mReceiverRegistered)
|
||||
{
|
||||
|
@ -288,7 +284,7 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
// too often can result in poor UI performance.
|
||||
if (RoutingController.get().isNavigating() && Framework.nativeIsRouteFinished())
|
||||
{
|
||||
mLogger.d(TAG, "End point is reached");
|
||||
Logger.d(TAG, "End point is reached");
|
||||
restart();
|
||||
if (mUiCallback != null)
|
||||
mUiCallback.onRoutingFinish();
|
||||
|
@ -299,11 +295,11 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
@Override
|
||||
public void onLocationChanged(@NonNull Location location)
|
||||
{
|
||||
mLogger.d(TAG, "onLocationChanged, location = " + location);
|
||||
Logger.d(TAG, "onLocationChanged, location = " + location);
|
||||
|
||||
if (!LocationUtils.isAccuracySatisfied(location))
|
||||
{
|
||||
mLogger.w(TAG, "Unsatisfied accuracy for location = " + location);
|
||||
Logger.w(TAG, "Unsatisfied accuracy for location = " + location);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -312,7 +308,7 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
final boolean isTrustedFused = mLocationProvider.trustFusedLocations() && LocationUtils.isFromFusedProvider(location);
|
||||
if (!isTrustedFused && !LocationUtils.isLocationBetterThanLast(location, mSavedLocation))
|
||||
{
|
||||
mLogger.d(TAG, "The new " + location + " is worse than the last " + mSavedLocation);
|
||||
Logger.d(TAG, "The new " + location + " is worse than the last " + mSavedLocation);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -325,14 +321,14 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
@Override
|
||||
public void onLocationError(int errCode)
|
||||
{
|
||||
mLogger.d(TAG, "onLocationError(): " + errCode);
|
||||
Logger.d(TAG, "onLocationError(): " + errCode);
|
||||
if (errCode == ERROR_NOT_SUPPORTED &&
|
||||
LocationUtils.areLocationServicesTurnedOn(mContext) &&
|
||||
!(mLocationProvider instanceof AndroidNativeProvider))
|
||||
{
|
||||
// If location service is enabled, try to downgrade to the native provider first
|
||||
// and restart the service before notifying the user.
|
||||
mLogger.d(TAG, "Downgrading to use native provider");
|
||||
Logger.d(TAG, "Downgrading to use native provider");
|
||||
mLocationProvider = new AndroidNativeProvider(mContext, this);
|
||||
restart();
|
||||
return;
|
||||
|
@ -345,7 +341,7 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
|
||||
private void notifyMyPositionModeChanged(int newMode)
|
||||
{
|
||||
mLogger.d(TAG, "notifyMyPositionModeChanged(): " + LocationState.nameOf(newMode));
|
||||
Logger.d(TAG, "notifyMyPositionModeChanged(): " + LocationState.nameOf(newMode));
|
||||
|
||||
if (mUiCallback != null)
|
||||
mUiCallback.onMyPositionModeChanged(newMode);
|
||||
|
@ -353,7 +349,7 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
|
||||
private void notifyLocationNotFound()
|
||||
{
|
||||
mLogger.d(TAG, "notifyLocationNotFound()");
|
||||
Logger.d(TAG, "notifyLocationNotFound()");
|
||||
if (mUiCallback != null)
|
||||
mUiCallback.onLocationNotFound();
|
||||
}
|
||||
|
@ -366,8 +362,8 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
@UiThread
|
||||
public void addListener(@NonNull LocationListener listener)
|
||||
{
|
||||
mLogger.d(TAG, "addListener(): " + listener);
|
||||
mLogger.d(TAG, " - listener count was: " + mListeners.getSize());
|
||||
Logger.d(TAG, "addListener(): " + listener);
|
||||
Logger.d(TAG, " - listener count was: " + mListeners.getSize());
|
||||
|
||||
mListeners.register(listener);
|
||||
if (mSavedLocation != null)
|
||||
|
@ -381,17 +377,17 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
*/
|
||||
public void removeListener(@NonNull LocationListener listener)
|
||||
{
|
||||
mLogger.d(TAG, "removeListener(), listener: " + listener);
|
||||
mLogger.d(TAG, " - listener count was: " + mListeners.getSize());
|
||||
Logger.d(TAG, "removeListener(), listener: " + listener);
|
||||
Logger.d(TAG, " - listener count was: " + mListeners.getSize());
|
||||
mListeners.unregister(listener);
|
||||
}
|
||||
|
||||
private void calcLocationUpdatesInterval()
|
||||
{
|
||||
mLogger.d(TAG, "calcLocationUpdatesInterval()");
|
||||
Logger.d(TAG, "calcLocationUpdatesInterval()");
|
||||
if (RoutingController.get().isNavigating())
|
||||
{
|
||||
mLogger.d(TAG, "calcLocationUpdatesInterval(), it's navigation mode");
|
||||
Logger.d(TAG, "calcLocationUpdatesInterval(), it's navigation mode");
|
||||
final @Framework.RouterType int router = Framework.nativeGetRouter();
|
||||
switch (router)
|
||||
{
|
||||
|
@ -467,28 +463,28 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
{
|
||||
if (mActive)
|
||||
{
|
||||
mLogger.w(TAG, "Provider '" + mLocationProvider + "' is already started");
|
||||
Logger.w(TAG, "Provider '" + mLocationProvider + "' is already started");
|
||||
return;
|
||||
}
|
||||
|
||||
if (isLocationUpdateStoppedByUser())
|
||||
{
|
||||
mLogger.d(TAG, "Location updates are stopped by the user manually, so skip provider start"
|
||||
+ " until the user starts it manually.");
|
||||
Logger.d(TAG, "Location updates are stopped by the user manually, so skip provider start"
|
||||
+ " until the user starts it manually.");
|
||||
onLocationError(ERROR_GPS_OFF);
|
||||
return;
|
||||
}
|
||||
|
||||
long oldInterval = mInterval;
|
||||
mLogger.d(TAG, "Old time interval (ms): " + oldInterval);
|
||||
Logger.d(TAG, "Old time interval (ms): " + oldInterval);
|
||||
calcLocationUpdatesInterval();
|
||||
if (!PermissionsUtils.isLocationGranted(mContext))
|
||||
{
|
||||
mLogger.w(TAG, "Dynamic permissions ACCESS_COARSE_LOCATION and/or ACCESS_FINE_LOCATION are granted");
|
||||
Logger.w(TAG, "Dynamic permissions ACCESS_COARSE_LOCATION and/or ACCESS_FINE_LOCATION are granted");
|
||||
onLocationError(ERROR_DENIED);
|
||||
return;
|
||||
}
|
||||
mLogger.i(TAG, "start(): interval = " + mInterval + " provider = '" + mLocationProvider + "' mInFirstRun = " + mInFirstRun);
|
||||
Logger.i(TAG, "start(): interval = " + mInterval + " provider = '" + mLocationProvider + "' mInFirstRun = " + mInFirstRun);
|
||||
checkForAgpsUpdates();
|
||||
mLocationProvider.start(mInterval);
|
||||
mSensorHelper.start();
|
||||
|
@ -501,10 +497,10 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
*/
|
||||
public void stop()
|
||||
{
|
||||
mLogger.i(TAG, "stop()");
|
||||
Logger.i(TAG, "stop()");
|
||||
if (!mActive)
|
||||
{
|
||||
mLogger.w(TAG, "Provider '" + mLocationProvider + "' is already stopped");
|
||||
Logger.w(TAG, "Provider '" + mLocationProvider + "' is already stopped");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -522,11 +518,11 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
long currentTimestamp = System.currentTimeMillis();
|
||||
if (previousTimestamp + AGPS_EXPIRATION_TIME_MS > currentTimestamp)
|
||||
{
|
||||
mLogger.d(TAG, "A-GPS should be up to date");
|
||||
Logger.d(TAG, "A-GPS should be up to date");
|
||||
return;
|
||||
}
|
||||
|
||||
mLogger.d(TAG, "Requesting new A-GPS data");
|
||||
Logger.d(TAG, "Requesting new A-GPS data");
|
||||
Config.setAgpsTimestamp(currentTimestamp);
|
||||
final LocationManager manager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
|
||||
manager.sendExtraCommand(LocationManager.GPS_PROVIDER, "force_xtra_injection", null);
|
||||
|
@ -539,11 +535,11 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
@UiThread
|
||||
public void attach(@NonNull UiCallback callback)
|
||||
{
|
||||
mLogger.d(TAG, "attach() callback = " + callback);
|
||||
Logger.d(TAG, "attach() callback = " + callback);
|
||||
|
||||
if (mUiCallback != null)
|
||||
{
|
||||
mLogger.d(TAG, " - already attached. Skip.");
|
||||
Logger.d(TAG, " - already attached. Skip.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -559,7 +555,7 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
|
||||
if (mActive)
|
||||
{
|
||||
mLogger.d(TAG, "attach() provider '" + mLocationProvider + "' is active, just add the listener");
|
||||
Logger.d(TAG, "attach() provider '" + mLocationProvider + "' is active, just add the listener");
|
||||
if (mSavedLocation != null)
|
||||
mCoreLocationListener.onLocationUpdated(mSavedLocation);
|
||||
}
|
||||
|
@ -575,11 +571,11 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
@UiThread
|
||||
public void detach(boolean delayed)
|
||||
{
|
||||
mLogger.d(TAG, "detach(), delayed: " + delayed);
|
||||
Logger.d(TAG, "detach(), delayed: " + delayed);
|
||||
|
||||
if (mUiCallback == null)
|
||||
{
|
||||
mLogger.d(TAG, " - already detached. Skip.");
|
||||
Logger.d(TAG, " - already detached. Skip.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -596,14 +592,14 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
@UiThread
|
||||
public void onEnteredIntoFirstRun()
|
||||
{
|
||||
mLogger.i(TAG, "onEnteredIntoFirstRun");
|
||||
Logger.i(TAG, "onEnteredIntoFirstRun");
|
||||
mInFirstRun = true;
|
||||
}
|
||||
|
||||
@UiThread
|
||||
public void onExitFromFirstRun()
|
||||
{
|
||||
mLogger.i(TAG, "onExitFromFirstRun");
|
||||
Logger.i(TAG, "onExitFromFirstRun");
|
||||
if (!mInFirstRun)
|
||||
throw new AssertionError("Must be called only after 'onEnteredIntoFirstRun' method!");
|
||||
|
||||
|
@ -614,7 +610,7 @@ public enum LocationHelper implements Initializable<Context>, AppBackgroundTrack
|
|||
if (mSavedLocation != null)
|
||||
{
|
||||
notifyLocationUpdated();
|
||||
mLogger.d(TAG, "Current location is available, so play the nice zoom animation");
|
||||
Logger.d(TAG, "Current location is available, so play the nice zoom animation");
|
||||
Framework.nativeRunFirstLaunchAnimation();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -6,11 +6,11 @@ import android.os.SystemClock;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mapswithme.maps.BuildConfig;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import javax.net.SocketFactory;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
@ -18,9 +18,6 @@ import java.net.Socket;
|
|||
import java.net.SocketException;
|
||||
import java.net.SocketTimeoutException;
|
||||
|
||||
import javax.net.SocketFactory;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
|
||||
/**
|
||||
* Implements interface that will be used by the core for
|
||||
* sending/receiving the raw data trough platform socket interface.
|
||||
|
@ -33,10 +30,9 @@ import javax.net.ssl.SSLSocketFactory;
|
|||
*/
|
||||
class PlatformSocket
|
||||
{
|
||||
private static final String TAG = PlatformSocket.class.getSimpleName();
|
||||
|
||||
private final static int DEFAULT_TIMEOUT = 30 * 1000;
|
||||
private final static String TAG = PlatformSocket.class.getSimpleName();
|
||||
@NonNull
|
||||
private final static Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.GPS_TRACKING);
|
||||
private static volatile long sSslConnectionCounter;
|
||||
@Nullable
|
||||
private Socket mSocket;
|
||||
|
@ -48,21 +44,21 @@ class PlatformSocket
|
|||
PlatformSocket()
|
||||
{
|
||||
sSslConnectionCounter = 0;
|
||||
LOGGER.d(TAG, "***********************************************************************************");
|
||||
LOGGER.d(TAG, "Platform socket is created by core, ssl connection counter is discarded.");
|
||||
Logger.d(TAG, "***********************************************************************************");
|
||||
Logger.d(TAG, "Platform socket is created by core, ssl connection counter is discarded.");
|
||||
}
|
||||
|
||||
public boolean open(@NonNull String host, int port)
|
||||
{
|
||||
if (mSocket != null)
|
||||
{
|
||||
LOGGER.e(TAG, "Socket is already opened. Seems that it wasn't closed.");
|
||||
Logger.e(TAG, "Socket is already opened. Seems that it wasn't closed.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isPortAllowed(port))
|
||||
{
|
||||
LOGGER.e(TAG, "A wrong port number = " + port + ", it must be within (0-65535) range");
|
||||
Logger.e(TAG, "A wrong port number = " + port + ", it must be within (0-65535) range");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -99,12 +95,12 @@ class PlatformSocket
|
|||
SocketFactory sf = getSocketFactory();
|
||||
socket = sf.createSocket(host, port);
|
||||
sSslConnectionCounter++;
|
||||
LOGGER.d(TAG, "###############################################################################");
|
||||
LOGGER.d(TAG, sSslConnectionCounter + " ssl connection is established.");
|
||||
Logger.d(TAG, "###############################################################################");
|
||||
Logger.d(TAG, sSslConnectionCounter + " ssl connection is established.");
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to create the ssl socket, mHost = " + host + " mPort = " + port);
|
||||
Logger.e(TAG, "Failed to create the ssl socket, mHost = " + host + " mPort = " + port);
|
||||
}
|
||||
return socket;
|
||||
}
|
||||
|
@ -116,11 +112,11 @@ class PlatformSocket
|
|||
try
|
||||
{
|
||||
socket = new Socket(host, port);
|
||||
LOGGER.d(TAG, "Regular socket is created and tcp handshake is passed successfully");
|
||||
Logger.d(TAG, "Regular socket is created and tcp handshake is passed successfully");
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to create the socket, mHost = " + host + " mPort = " + port);
|
||||
Logger.e(TAG, "Failed to create the socket, mHost = " + host + " mPort = " + port);
|
||||
}
|
||||
return socket;
|
||||
}
|
||||
|
@ -142,17 +138,17 @@ class PlatformSocket
|
|||
{
|
||||
if (mSocket == null)
|
||||
{
|
||||
LOGGER.d(TAG, "Socket is already closed or it wasn't opened yet\n");
|
||||
Logger.d(TAG, "Socket is already closed or it wasn't opened yet\n");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
mSocket.close();
|
||||
LOGGER.d(TAG, "Socket has been closed: " + this + "\n");
|
||||
Logger.d(TAG, "Socket has been closed: " + this + "\n");
|
||||
} catch (IOException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to close socket: " + this + "\n");
|
||||
Logger.e(TAG, "Failed to close socket: " + this + "\n");
|
||||
} finally
|
||||
{
|
||||
mSocket = null;
|
||||
|
@ -164,7 +160,7 @@ class PlatformSocket
|
|||
if (!checkSocketAndArguments(data, count))
|
||||
return false;
|
||||
|
||||
LOGGER.d(TAG, "Reading method is started, data.length = " + data.length + ", count = " + count);
|
||||
Logger.d(TAG, "Reading method is started, data.length = " + data.length + ", count = " + count);
|
||||
long startTime = SystemClock.elapsedRealtime();
|
||||
int readBytes = 0;
|
||||
try
|
||||
|
@ -177,30 +173,30 @@ class PlatformSocket
|
|||
{
|
||||
try
|
||||
{
|
||||
LOGGER.d(TAG, "Attempting to read " + count + " bytes from offset = " + readBytes);
|
||||
Logger.d(TAG, "Attempting to read " + count + " bytes from offset = " + readBytes);
|
||||
int read = in.read(data, readBytes, count - readBytes);
|
||||
|
||||
if (read == -1)
|
||||
{
|
||||
LOGGER.d(TAG, "All data is read from the stream, read bytes count = " + readBytes + "\n");
|
||||
Logger.d(TAG, "All data is read from the stream, read bytes count = " + readBytes + "\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (read == 0)
|
||||
{
|
||||
LOGGER.e(TAG, "0 bytes are obtained. It's considered as error\n");
|
||||
Logger.e(TAG, "0 bytes are obtained. It's considered as error\n");
|
||||
break;
|
||||
}
|
||||
|
||||
LOGGER.d(TAG, "Read bytes count = " + read + "\n");
|
||||
Logger.d(TAG, "Read bytes count = " + read + "\n");
|
||||
readBytes += read;
|
||||
} catch (SocketTimeoutException e)
|
||||
{
|
||||
long readingTime = SystemClock.elapsedRealtime() - startTime;
|
||||
LOGGER.e(TAG, "Socked timeout has occurred after " + readingTime + " (ms)\n ");
|
||||
Logger.e(TAG, "Socked timeout has occurred after " + readingTime + " (ms)\n ");
|
||||
if (readingTime > mTimeout)
|
||||
{
|
||||
LOGGER.e(TAG, "Socket wrapper timeout has occurred, requested count = " +
|
||||
Logger.e(TAG, "Socket wrapper timeout has occurred, requested count = " +
|
||||
(count - readBytes) + ", readBytes = " + readBytes + "\n");
|
||||
break;
|
||||
}
|
||||
|
@ -208,7 +204,7 @@ class PlatformSocket
|
|||
}
|
||||
} catch (IOException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to read data from socket: " + this + "\n");
|
||||
Logger.e(TAG, "Failed to read data from socket: " + this + "\n");
|
||||
}
|
||||
|
||||
return count == readBytes;
|
||||
|
@ -219,7 +215,7 @@ class PlatformSocket
|
|||
if (!checkSocketAndArguments(data, count))
|
||||
return false;
|
||||
|
||||
LOGGER.d(TAG, "Writing method is started, data.length = " + data.length + ", count = " + count);
|
||||
Logger.d(TAG, "Writing method is started, data.length = " + data.length + ", count = " + count);
|
||||
long startTime = SystemClock.elapsedRealtime();
|
||||
try
|
||||
{
|
||||
|
@ -228,15 +224,15 @@ class PlatformSocket
|
|||
|
||||
OutputStream out = mSocket.getOutputStream();
|
||||
out.write(data, 0, count);
|
||||
LOGGER.d(TAG, count + " bytes are written\n");
|
||||
Logger.d(TAG, count + " bytes are written\n");
|
||||
return true;
|
||||
} catch (SocketTimeoutException e)
|
||||
{
|
||||
long writingTime = SystemClock.elapsedRealtime() - startTime;
|
||||
LOGGER.e(TAG, "Socked timeout has occurred after " + writingTime + " (ms)\n");
|
||||
Logger.e(TAG, "Socked timeout has occurred after " + writingTime + " (ms)\n");
|
||||
} catch (IOException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to write data to socket: " + this + "\n");
|
||||
Logger.e(TAG, "Failed to write data to socket: " + this + "\n");
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -246,13 +242,13 @@ class PlatformSocket
|
|||
{
|
||||
if (mSocket == null)
|
||||
{
|
||||
LOGGER.e(TAG, "Socket must be opened before reading/writing\n");
|
||||
Logger.e(TAG, "Socket must be opened before reading/writing\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (count < 0 || count > data.length)
|
||||
{
|
||||
LOGGER.e(TAG, "Illegal arguments, data.length = " + data.length + ", count = " + count + "\n");
|
||||
Logger.e(TAG, "Illegal arguments, data.length = " + data.length + ", count = " + count + "\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -262,7 +258,7 @@ class PlatformSocket
|
|||
public void setTimeout(int millis)
|
||||
{
|
||||
mTimeout = millis;
|
||||
LOGGER.d(TAG, "Setting the socket wrapper timeout = " + millis + " ms\n");
|
||||
Logger.d(TAG, "Setting the socket wrapper timeout = " + millis + " ms\n");
|
||||
}
|
||||
|
||||
private void setReadSocketTimeout(@NonNull Socket socket, int millis)
|
||||
|
@ -272,7 +268,7 @@ class PlatformSocket
|
|||
socket.setSoTimeout(millis);
|
||||
} catch (SocketException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to set system socket timeout: " + millis + "ms, " + this + "\n");
|
||||
Logger.e(TAG, "Failed to set system socket timeout: " + millis + "ms, " + this + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,10 +3,8 @@ package com.mapswithme.maps.maplayer.traffic;
|
|||
import androidx.annotation.MainThread;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mapswithme.maps.base.Initializable;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -15,9 +13,8 @@ import java.util.List;
|
|||
public enum TrafficManager implements Initializable<Void>
|
||||
{
|
||||
INSTANCE;
|
||||
private final static String TAG = TrafficManager.class.getSimpleName();
|
||||
@NonNull
|
||||
private final Logger mLogger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.TRAFFIC);
|
||||
|
||||
private static final String TAG = TrafficManager.class.getSimpleName();
|
||||
|
||||
@NonNull
|
||||
private final TrafficState.StateChangeListener mStateChangeListener = new TrafficStateListener();
|
||||
|
@ -33,7 +30,7 @@ public enum TrafficManager implements Initializable<Void>
|
|||
@Override
|
||||
public void initialize(@Nullable Void aVoid)
|
||||
{
|
||||
mLogger.d(TAG, "Initialization of traffic manager and setting the listener for traffic state changes");
|
||||
Logger.d(TAG, "Initialization of traffic manager and setting the listener for traffic state changes");
|
||||
TrafficState.nativeSetListener(mStateChangeListener);
|
||||
mInitialized = true;
|
||||
}
|
||||
|
@ -56,7 +53,7 @@ public enum TrafficManager implements Initializable<Void>
|
|||
|
||||
private void enable()
|
||||
{
|
||||
mLogger.d(TAG, "Enable traffic");
|
||||
Logger.d(TAG, "Enable traffic");
|
||||
TrafficState.nativeEnable();
|
||||
}
|
||||
|
||||
|
@ -64,7 +61,7 @@ public enum TrafficManager implements Initializable<Void>
|
|||
{
|
||||
checkInitialization();
|
||||
|
||||
mLogger.d(TAG, "Disable traffic");
|
||||
Logger.d(TAG, "Disable traffic");
|
||||
TrafficState.nativeDisable();
|
||||
}
|
||||
|
||||
|
@ -83,7 +80,7 @@ public enum TrafficManager implements Initializable<Void>
|
|||
throw new IllegalStateException("A callback '" + callback
|
||||
+ "' is already attached. Check that the 'detachAll' method was called.");
|
||||
}
|
||||
mLogger.d(TAG, "Attach callback '" + callback + "'");
|
||||
Logger.d(TAG, "Attach callback '" + callback + "'");
|
||||
mCallbacks.add(callback);
|
||||
postPendingState();
|
||||
}
|
||||
|
@ -99,13 +96,13 @@ public enum TrafficManager implements Initializable<Void>
|
|||
|
||||
if (mCallbacks.isEmpty())
|
||||
{
|
||||
mLogger.w(TAG, "There are no attached callbacks. Invoke the 'detachAll' method " +
|
||||
"only when it's really needed!", new Throwable());
|
||||
Logger.w(TAG, "There are no attached callbacks. Invoke the 'detachAll' method " +
|
||||
"only when it's really needed!", new Throwable());
|
||||
return;
|
||||
}
|
||||
|
||||
for (TrafficCallback callback : mCallbacks)
|
||||
mLogger.d(TAG, "Detach callback '" + callback + "'");
|
||||
Logger.d(TAG, "Detach callback '" + callback + "'");
|
||||
mCallbacks.clear();
|
||||
}
|
||||
|
||||
|
@ -135,8 +132,8 @@ public enum TrafficManager implements Initializable<Void>
|
|||
public void onTrafficStateChanged(int index)
|
||||
{
|
||||
TrafficState newTrafficState = TrafficState.values()[index];
|
||||
mLogger.d(TAG, "onTrafficStateChanged current state = " + mState
|
||||
+ " new value = " + newTrafficState);
|
||||
Logger.d(TAG, "onTrafficStateChanged current state = " + mState +
|
||||
" new value = " + newTrafficState);
|
||||
|
||||
if (mState == newTrafficState)
|
||||
return;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.mapswithme.maps.routing;
|
||||
|
||||
import static androidx.core.app.NotificationCompat.Builder;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
|
@ -19,7 +17,6 @@ import android.widget.RemoteViews;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.MwmActivity;
|
||||
import com.mapswithme.maps.R;
|
||||
|
@ -28,21 +25,21 @@ import com.mapswithme.maps.location.LocationListener;
|
|||
import com.mapswithme.maps.sound.TtsPlayer;
|
||||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import static androidx.core.app.NotificationCompat.Builder;
|
||||
|
||||
public class NavigationService extends Service
|
||||
{
|
||||
private static final String TAG = NavigationService.class.getSimpleName();
|
||||
|
||||
public static final String PACKAGE_NAME = NavigationService.class.getPackage().getName();
|
||||
public static final String PACKAGE_NAME_WITH_SERVICE_NAME = PACKAGE_NAME.concat(".")
|
||||
.concat(TAG.toLowerCase());
|
||||
public static final String PACKAGE_NAME_WITH_SERVICE_NAME = PACKAGE_NAME + "." +
|
||||
NavigationService.class.getSimpleName().toLowerCase();
|
||||
private static final String EXTRA_STOP_SERVICE = PACKAGE_NAME_WITH_SERVICE_NAME + "finish";
|
||||
|
||||
private static final String CHANNEL_ID = "LOCATION_CHANNEL";
|
||||
private static final int NOTIFICATION_ID = 12345678;
|
||||
|
||||
@NonNull
|
||||
private final Logger mLogger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.LOCATION);
|
||||
@NonNull
|
||||
private final IBinder mBinder = new LocalBinder();
|
||||
@SuppressWarnings("NotNullFieldNotInitialized")
|
||||
|
@ -64,7 +61,7 @@ public class NavigationService extends Service
|
|||
@Override
|
||||
public void onLocationUpdated(Location location)
|
||||
{
|
||||
mLogger.d(TAG, "onLocationUpdated()");
|
||||
Logger.d(TAG, "onLocationUpdated()");
|
||||
RoutingInfo routingInfo = Framework.nativeGetRouteFollowingInfo();
|
||||
if (serviceIsRunningInForeground(getApplicationContext()))
|
||||
{
|
||||
|
@ -76,7 +73,7 @@ public class NavigationService extends Service
|
|||
@Override
|
||||
public void onLocationError(int errorCode)
|
||||
{
|
||||
mLogger.e(TAG, "onLocationError() errorCode: " + errorCode);
|
||||
Logger.e(TAG, "onLocationError() errorCode: " + errorCode);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -117,13 +114,13 @@ public class NavigationService extends Service
|
|||
public void onLowMemory()
|
||||
{
|
||||
super.onLowMemory();
|
||||
mLogger.d(TAG, "onLowMemory()");
|
||||
Logger.d(TAG, "onLowMemory()");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId)
|
||||
{
|
||||
mLogger.i(TAG, "Service started");
|
||||
Logger.i(TAG, "Service started");
|
||||
LocationHelper.INSTANCE.addListener(mLocationListener);
|
||||
boolean finishedFromNotification = intent.getBooleanExtra(EXTRA_STOP_SERVICE,
|
||||
false);
|
||||
|
@ -146,7 +143,7 @@ public class NavigationService extends Service
|
|||
@Override
|
||||
public IBinder onBind(Intent intent)
|
||||
{
|
||||
mLogger.i(TAG, "in onBind()");
|
||||
Logger.i(TAG, "in onBind()");
|
||||
stopForeground(true);
|
||||
mChangingConfiguration = false;
|
||||
return mBinder;
|
||||
|
@ -155,7 +152,7 @@ public class NavigationService extends Service
|
|||
@Override
|
||||
public void onRebind(Intent intent)
|
||||
{
|
||||
mLogger.i(TAG, "in onRebind()");
|
||||
Logger.i(TAG, "in onRebind()");
|
||||
stopForeground(true);
|
||||
mChangingConfiguration = false;
|
||||
super.onRebind(intent);
|
||||
|
@ -164,7 +161,7 @@ public class NavigationService extends Service
|
|||
@Override
|
||||
public boolean onUnbind(Intent intent)
|
||||
{
|
||||
mLogger.i(TAG, "Last client unbound from service");
|
||||
Logger.i(TAG, "Last client unbound from service");
|
||||
|
||||
// Called when the last client unbinds from this
|
||||
// service. If this method is called due to a configuration change in activity, we
|
||||
|
@ -172,7 +169,7 @@ public class NavigationService extends Service
|
|||
removeLocationUpdates();
|
||||
if (!mChangingConfiguration)
|
||||
{
|
||||
mLogger.i(TAG, "Starting foreground service");
|
||||
Logger.i(TAG, "Starting foreground service");
|
||||
startForeground(NOTIFICATION_ID, getNotification());
|
||||
}
|
||||
return true;
|
||||
|
@ -182,7 +179,7 @@ public class NavigationService extends Service
|
|||
{
|
||||
if(!serviceIsRunningInForeground(this))
|
||||
{
|
||||
mLogger.i(TAG, "Starting foreground service");
|
||||
Logger.i(TAG, "Starting foreground service");
|
||||
startForeground(NOTIFICATION_ID, getNotification());
|
||||
}
|
||||
}
|
||||
|
@ -247,7 +244,7 @@ public class NavigationService extends Service
|
|||
|
||||
private void removeLocationUpdates()
|
||||
{
|
||||
mLogger.i(TAG, "Removing location updates");
|
||||
Logger.i(TAG, "Removing location updates");
|
||||
LocationHelper.INSTANCE.removeListener(mLocationListener);
|
||||
stopSelf();
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ import androidx.annotation.Nullable;
|
|||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.util.Pair;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
import com.mapswithme.maps.R;
|
||||
|
@ -29,7 +28,6 @@ import com.mapswithme.util.StringUtils;
|
|||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.concurrency.UiThread;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -85,7 +83,7 @@ public class RoutingController implements Initializable<Void>
|
|||
|
||||
private static final int NO_WAITING_POI_PICK = -1;
|
||||
private static final RoutingController sInstance = new RoutingController();
|
||||
private final Logger mLogger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.ROUTING);
|
||||
|
||||
@Nullable
|
||||
private Container mContainer;
|
||||
|
||||
|
@ -116,7 +114,7 @@ public class RoutingController implements Initializable<Void>
|
|||
@Override
|
||||
public void onRoutingEvent(final int resultCode, @Nullable final String[] missingMaps)
|
||||
{
|
||||
mLogger.d(TAG, "onRoutingEvent(resultCode: " + resultCode + ")");
|
||||
Logger.d(TAG, "onRoutingEvent(resultCode: " + resultCode + ")");
|
||||
mLastResultCode = resultCode;
|
||||
mLastMissingMaps = missingMaps;
|
||||
mContainsCachedResult = true;
|
||||
|
@ -224,7 +222,7 @@ public class RoutingController implements Initializable<Void>
|
|||
|
||||
private void setState(State newState)
|
||||
{
|
||||
mLogger.d(TAG, "[S] State: " + mState + " -> " + newState + ", BuildState: " + mBuildState);
|
||||
Logger.d(TAG, "[S] State: " + mState + " -> " + newState + ", BuildState: " + mBuildState);
|
||||
mState = newState;
|
||||
|
||||
if (mContainer != null)
|
||||
|
@ -233,7 +231,7 @@ public class RoutingController implements Initializable<Void>
|
|||
|
||||
private void setBuildState(BuildState newState)
|
||||
{
|
||||
mLogger.d(TAG, "[B] State: " + mState + ", BuildState: " + mBuildState + " -> " + newState);
|
||||
Logger.d(TAG, "[B] State: " + mState + ", BuildState: " + mBuildState + " -> " + newState);
|
||||
mBuildState = newState;
|
||||
|
||||
if (mBuildState == BuildState.BUILT && !MapObject.isOfType(MapObject.MY_POSITION, getStartPoint()))
|
||||
|
@ -320,7 +318,7 @@ public class RoutingController implements Initializable<Void>
|
|||
{
|
||||
Framework.nativeRemoveRoute();
|
||||
|
||||
mLogger.d(TAG, "build");
|
||||
Logger.d(TAG, "build");
|
||||
mLastBuildProgress = 0;
|
||||
|
||||
setBuildState(BuildState.BUILDING);
|
||||
|
@ -396,7 +394,7 @@ public class RoutingController implements Initializable<Void>
|
|||
|
||||
public void prepare(@Nullable MapObject startPoint, @Nullable MapObject endPoint, boolean fromApi)
|
||||
{
|
||||
mLogger.d(TAG, "prepare (" + (endPoint == null ? "route)" : "p2p)"));
|
||||
Logger.d(TAG, "prepare (" + (endPoint == null ? "route)" : "p2p)"));
|
||||
|
||||
if (!Config.isRoutingDisclaimerAccepted())
|
||||
{
|
||||
|
@ -450,7 +448,7 @@ public class RoutingController implements Initializable<Void>
|
|||
|
||||
public void start()
|
||||
{
|
||||
mLogger.d(TAG, "start");
|
||||
Logger.d(TAG, "start");
|
||||
|
||||
// This saving is needed just for situation when the user starts navigation
|
||||
// and then app crashes. So, the previous route will be restored on the next app launch.
|
||||
|
@ -599,7 +597,7 @@ public class RoutingController implements Initializable<Void>
|
|||
|
||||
private void cancelInternal()
|
||||
{
|
||||
mLogger.d(TAG, "cancelInternal");
|
||||
Logger.d(TAG, "cancelInternal");
|
||||
|
||||
//noinspection WrongConstant
|
||||
mWaitingPoiPickType = NO_WAITING_POI_PICK;
|
||||
|
@ -616,7 +614,7 @@ public class RoutingController implements Initializable<Void>
|
|||
{
|
||||
if (isPlanning())
|
||||
{
|
||||
mLogger.d(TAG, "cancel: planning");
|
||||
Logger.d(TAG, "cancel: planning");
|
||||
|
||||
cancelInternal();
|
||||
cancelPlanning();
|
||||
|
@ -625,7 +623,7 @@ public class RoutingController implements Initializable<Void>
|
|||
|
||||
if (isNavigating())
|
||||
{
|
||||
mLogger.d(TAG, "cancel: navigating");
|
||||
Logger.d(TAG, "cancel: navigating");
|
||||
|
||||
cancelInternal();
|
||||
cancelNavigation();
|
||||
|
@ -636,7 +634,7 @@ public class RoutingController implements Initializable<Void>
|
|||
return true;
|
||||
}
|
||||
|
||||
mLogger.d(TAG, "cancel: none");
|
||||
Logger.d(TAG, "cancel: none");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -826,12 +824,12 @@ public class RoutingController implements Initializable<Void>
|
|||
|
||||
private boolean setStartFromMyPosition()
|
||||
{
|
||||
mLogger.d(TAG, "setStartFromMyPosition");
|
||||
Logger.d(TAG, "setStartFromMyPosition");
|
||||
|
||||
MapObject my = LocationHelper.INSTANCE.getMyPosition();
|
||||
if (my == null)
|
||||
{
|
||||
mLogger.d(TAG, "setStartFromMyPosition: no my position - skip");
|
||||
Logger.d(TAG, "setStartFromMyPosition: no my position - skip");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -851,7 +849,7 @@ public class RoutingController implements Initializable<Void>
|
|||
@SuppressWarnings("Duplicates")
|
||||
public boolean setStartPoint(@Nullable MapObject point)
|
||||
{
|
||||
mLogger.d(TAG, "setStartPoint");
|
||||
Logger.d(TAG, "setStartPoint");
|
||||
MapObject startPoint = getStartPoint();
|
||||
MapObject endPoint = getEndPoint();
|
||||
boolean isSamePoint = MapObject.same(startPoint, point);
|
||||
|
@ -864,7 +862,7 @@ public class RoutingController implements Initializable<Void>
|
|||
|
||||
if (isSamePoint)
|
||||
{
|
||||
mLogger.d(TAG, "setStartPoint: skip the same starting point");
|
||||
Logger.d(TAG, "setStartPoint: skip the same starting point");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -872,11 +870,11 @@ public class RoutingController implements Initializable<Void>
|
|||
{
|
||||
if (startPoint == null)
|
||||
{
|
||||
mLogger.d(TAG, "setStartPoint: skip because starting point is empty");
|
||||
Logger.d(TAG, "setStartPoint: skip because starting point is empty");
|
||||
return false;
|
||||
}
|
||||
|
||||
mLogger.d(TAG, "setStartPoint: swap with end point");
|
||||
Logger.d(TAG, "setStartPoint: swap with end point");
|
||||
endPoint = startPoint;
|
||||
}
|
||||
|
||||
|
@ -899,7 +897,7 @@ public class RoutingController implements Initializable<Void>
|
|||
@SuppressWarnings("Duplicates")
|
||||
public boolean setEndPoint(@Nullable MapObject point)
|
||||
{
|
||||
mLogger.d(TAG, "setEndPoint");
|
||||
Logger.d(TAG, "setEndPoint");
|
||||
MapObject startPoint = getStartPoint();
|
||||
MapObject endPoint = getEndPoint();
|
||||
boolean isSamePoint = MapObject.same(endPoint, point);
|
||||
|
@ -913,7 +911,7 @@ public class RoutingController implements Initializable<Void>
|
|||
|
||||
if (isSamePoint)
|
||||
{
|
||||
mLogger.d(TAG, "setEndPoint: skip the same end point");
|
||||
Logger.d(TAG, "setEndPoint: skip the same end point");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -921,11 +919,11 @@ public class RoutingController implements Initializable<Void>
|
|||
{
|
||||
if (endPoint == null)
|
||||
{
|
||||
mLogger.d(TAG, "setEndPoint: skip because end point is empty");
|
||||
Logger.d(TAG, "setEndPoint: skip because end point is empty");
|
||||
return false;
|
||||
}
|
||||
|
||||
mLogger.d(TAG, "setEndPoint: swap with starting point");
|
||||
Logger.d(TAG, "setEndPoint: swap with starting point");
|
||||
startPoint = endPoint;
|
||||
|
||||
}
|
||||
|
@ -974,7 +972,7 @@ public class RoutingController implements Initializable<Void>
|
|||
|
||||
private void swapPoints()
|
||||
{
|
||||
mLogger.d(TAG, "swapPoints");
|
||||
Logger.d(TAG, "swapPoints");
|
||||
|
||||
MapObject startPoint = getStartPoint();
|
||||
MapObject endPoint = getEndPoint();
|
||||
|
@ -990,7 +988,7 @@ public class RoutingController implements Initializable<Void>
|
|||
|
||||
public void setRouterType(@Framework.RouterType int router)
|
||||
{
|
||||
mLogger.d(TAG, "setRouterType: " + mLastRouterType + " -> " + router);
|
||||
Logger.d(TAG, "setRouterType: " + mLastRouterType + " -> " + router);
|
||||
|
||||
// Repeating tap on Taxi icon should trigger the route building always,
|
||||
// because it may be "No internet connection, try later" case
|
||||
|
|
|
@ -280,7 +280,8 @@ class SearchWheel implements View.OnClickListener
|
|||
{
|
||||
mCurrentOption = searchOption;
|
||||
final String query = mFrame.getContext().getString(searchOption.mQueryId);
|
||||
SearchEngine.INSTANCE.searchInteractive(mFrame.getContext(), query, System.nanoTime(), false /* isMapAndTable */);
|
||||
// Category request from navigation search wheel.
|
||||
SearchEngine.INSTANCE.searchInteractive(mFrame.getContext(), query, true, System.nanoTime(), false);
|
||||
SearchEngine.INSTANCE.setQuery(query);
|
||||
refreshSearchButtonImage();
|
||||
toggleSearchLayout();
|
||||
|
|
|
@ -5,15 +5,12 @@ import android.content.Context;
|
|||
import androidx.annotation.MainThread;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.api.ParsedMwmRequest;
|
||||
import com.mapswithme.maps.base.Initializable;
|
||||
import com.mapswithme.util.Language;
|
||||
import com.mapswithme.util.Listeners;
|
||||
import com.mapswithme.util.concurrency.UiThread;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
|
@ -24,9 +21,6 @@ public enum SearchEngine implements NativeSearchListener,
|
|||
{
|
||||
INSTANCE;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = SearchEngine.class.getSimpleName();
|
||||
|
||||
// Query, which results are shown on the map.
|
||||
@Nullable
|
||||
private String mQuery;
|
||||
|
@ -127,25 +121,26 @@ public enum SearchEngine implements NativeSearchListener,
|
|||
* @return whether search was actually started.
|
||||
*/
|
||||
@MainThread
|
||||
public boolean search(@NonNull Context context, String query, long timestamp, boolean hasLocation,
|
||||
double lat, double lon)
|
||||
public boolean search(@NonNull Context context, String query, boolean isCategory,
|
||||
long timestamp, boolean hasLocation, double lat, double lon)
|
||||
{
|
||||
return nativeRunSearch(query.getBytes(StandardCharsets.UTF_8), Language.getKeyboardLocale(context),
|
||||
timestamp, hasLocation, lat, lon);
|
||||
return nativeRunSearch(query.getBytes(StandardCharsets.UTF_8), isCategory,
|
||||
Language.getKeyboardLocale(context), timestamp, hasLocation, lat, lon);
|
||||
}
|
||||
|
||||
@MainThread
|
||||
public void searchInteractive(@NonNull String query, @NonNull String locale, long timestamp,
|
||||
boolean isMapAndTable)
|
||||
public void searchInteractive(@NonNull String query, boolean isCategory, @NonNull String locale,
|
||||
long timestamp, boolean isMapAndTable)
|
||||
{
|
||||
nativeRunInteractiveSearch(query.getBytes(StandardCharsets.UTF_8), locale, timestamp, isMapAndTable);
|
||||
nativeRunInteractiveSearch(query.getBytes(StandardCharsets.UTF_8), isCategory,
|
||||
locale, timestamp, isMapAndTable);
|
||||
}
|
||||
|
||||
@MainThread
|
||||
public void searchInteractive(@NonNull Context context, @NonNull String query, long timestamp,
|
||||
boolean isMapAndTable)
|
||||
public void searchInteractive(@NonNull Context context, @NonNull String query, boolean isCategory,
|
||||
long timestamp, boolean isMapAndTable)
|
||||
{
|
||||
searchInteractive(query, Language.getKeyboardLocale(context), timestamp, isMapAndTable);
|
||||
searchInteractive(query, isCategory, Language.getKeyboardLocale(context), timestamp, isMapAndTable);
|
||||
}
|
||||
|
||||
@MainThread
|
||||
|
@ -223,13 +218,15 @@ public enum SearchEngine implements NativeSearchListener,
|
|||
/**
|
||||
* @param bytes utf-8 formatted bytes of query.
|
||||
*/
|
||||
private static native boolean nativeRunSearch(byte[] bytes, String language, long timestamp, boolean hasLocation,
|
||||
private static native boolean nativeRunSearch(byte[] bytes, boolean isCategory,
|
||||
String language, long timestamp, boolean hasLocation,
|
||||
double lat, double lon);
|
||||
|
||||
/**
|
||||
* @param bytes utf-8 formatted query bytes
|
||||
*/
|
||||
private static native void nativeRunInteractiveSearch(byte[] bytes, String language, long timestamp,
|
||||
private static native void nativeRunInteractiveSearch(byte[] bytes, boolean isCategory,
|
||||
String language, long timestamp,
|
||||
boolean isMapAndTable);
|
||||
|
||||
/**
|
||||
|
|
|
@ -348,15 +348,9 @@ public class SearchFragment extends BaseMwmFragment
|
|||
super.onDestroy();
|
||||
}
|
||||
|
||||
private String getQuery()
|
||||
{
|
||||
return mToolbarController.getQuery();
|
||||
}
|
||||
|
||||
void setQuery(String text)
|
||||
{
|
||||
mToolbarController.setQuery(text);
|
||||
}
|
||||
private String getQuery() { return mToolbarController.getQuery(); }
|
||||
private boolean isCategory() { return mToolbarController.isCategory(); }
|
||||
void setQuery(String text) { mToolbarController.setQuery(text); }
|
||||
|
||||
private void readArguments()
|
||||
{
|
||||
|
@ -436,12 +430,12 @@ public class SearchFragment extends BaseMwmFragment
|
|||
mLastQueryTimestamp = System.nanoTime();
|
||||
|
||||
SearchEngine.INSTANCE.searchInteractive(
|
||||
query, !TextUtils.isEmpty(mInitialLocale)
|
||||
query, isCategory(), !TextUtils.isEmpty(mInitialLocale)
|
||||
? mInitialLocale : com.mapswithme.util.Language.getKeyboardLocale(requireContext()),
|
||||
mLastQueryTimestamp, false /* isMapAndTable */);
|
||||
|
||||
SearchEngine.INSTANCE.setQuery(query);
|
||||
Utils.navigateToParent(getActivity());
|
||||
|
||||
}
|
||||
|
||||
private void onSearchEnd()
|
||||
|
@ -479,12 +473,13 @@ public class SearchFragment extends BaseMwmFragment
|
|||
mLastQueryTimestamp = System.nanoTime();
|
||||
if (isTabletSearch())
|
||||
{
|
||||
SearchEngine.INSTANCE.searchInteractive(requireContext(), getQuery(), mLastQueryTimestamp, true /* isMapAndTable */);
|
||||
SearchEngine.INSTANCE.searchInteractive(requireContext(), getQuery(), isCategory(),
|
||||
mLastQueryTimestamp, true /* isMapAndTable */);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SearchEngine.INSTANCE.search(requireContext(), getQuery(), mLastQueryTimestamp, mLastPosition.valid,
|
||||
mLastPosition.lat, mLastPosition.lon))
|
||||
if (!SearchEngine.INSTANCE.search(requireContext(), getQuery(), isCategory(),
|
||||
mLastQueryTimestamp, mLastPosition.valid, mLastPosition.lat, mLastPosition.lon))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -518,7 +513,7 @@ public class SearchFragment extends BaseMwmFragment
|
|||
@Override
|
||||
public void onSearchCategorySelected(@Nullable String category)
|
||||
{
|
||||
mToolbarController.setQuery(category);
|
||||
mToolbarController.setQuery(category, true);
|
||||
}
|
||||
|
||||
private void refreshSearchResults(@NonNull SearchResult[] results)
|
||||
|
|
|
@ -21,7 +21,6 @@ import androidx.preference.Preference;
|
|||
import androidx.preference.PreferenceCategory;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
import androidx.preference.TwoStatePreference;
|
||||
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.downloader.MapManager;
|
||||
|
@ -40,7 +39,7 @@ import com.mapswithme.util.SharedPropertiesUtils;
|
|||
import com.mapswithme.util.ThemeSwitcher;
|
||||
import com.mapswithme.util.UiUtils;
|
||||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
import com.mapswithme.util.log.LogsManager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -481,16 +480,16 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
|
|||
if (pref == null)
|
||||
return;
|
||||
|
||||
final boolean isLoggingEnabled = LoggerFactory.INSTANCE.isFileLoggingEnabled();
|
||||
((TwoStatePreference) pref).setChecked(isLoggingEnabled);
|
||||
pref.setOnPreferenceChangeListener(
|
||||
(preference, newValue) ->
|
||||
{
|
||||
boolean newVal = (Boolean) newValue;
|
||||
if (isLoggingEnabled != newVal)
|
||||
LoggerFactory.INSTANCE.setFileLoggingEnabled(newVal);
|
||||
return true;
|
||||
});
|
||||
((TwoStatePreference) pref).setChecked(LogsManager.INSTANCE.isFileLoggingEnabled());
|
||||
pref.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
if (!LogsManager.INSTANCE.setFileLoggingEnabled((Boolean) newValue))
|
||||
{
|
||||
// It's a very rare condition when debugging, so we can do without translation.
|
||||
Utils.showSnackbar(getView(), "ERROR: Can't create a logs folder!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
private void initEmulationBadStorage()
|
||||
|
|
|
@ -46,9 +46,9 @@ public class StoragePathFragment extends BaseSettingsFragment
|
|||
mAdapter = new StoragePathAdapter(mPathManager, requireActivity());
|
||||
|
||||
mHeader = root.findViewById(R.id.header);
|
||||
ListView mList = root.findViewById(R.id.list);
|
||||
mList.setOnItemClickListener((parent, view, position, id) -> changeStorage(position));
|
||||
mList.setAdapter(mAdapter);
|
||||
final ListView list = root.findViewById(R.id.list);
|
||||
list.setOnItemClickListener((parent, view, position, id) -> changeStorage(position));
|
||||
list.setAdapter(mAdapter);
|
||||
|
||||
return root;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ import com.mapswithme.util.Config;
|
|||
import com.mapswithme.util.StorageUtils;
|
||||
import com.mapswithme.util.concurrency.UiThread;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
|
@ -30,8 +29,7 @@ import java.util.List;
|
|||
|
||||
public class StoragePathManager
|
||||
{
|
||||
static final String TAG = StoragePathManager.class.getName();
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.STORAGE);
|
||||
private static final String TAG = StoragePathManager.class.getSimpleName();
|
||||
private static final String DATA_FILE_EXT = Framework.nativeGetDataFileExt();
|
||||
private static final String[] MOVABLE_EXTS = Framework.nativeGetMovableFilesExts();
|
||||
static final FilenameFilter MOVABLE_FILES_FILTER = (dir, filename) -> {
|
||||
|
@ -127,7 +125,7 @@ public class StoragePathManager
|
|||
// https://github.com/organicmaps/organicmaps/issues/632
|
||||
if (dir == null)
|
||||
{
|
||||
LOGGER.w(TAG, "The system returned 'null' " + (isInternal ? "internal" : "external") + " storage");
|
||||
Logger.w(TAG, "The system returned 'null' " + (isInternal ? "internal" : "external") + " storage");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -138,11 +136,14 @@ public class StoragePathManager
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
LOGGER.e(TAG, "IOException at getCanonicalPath for " + dir.getPath(), e);
|
||||
Logger.e(TAG, "IOException at getCanonicalPath for " + dir.getPath(), e);
|
||||
return;
|
||||
}
|
||||
// Add the trailing separator because the native code assumes that all paths have it.
|
||||
path = StorageUtils.addTrailingSeparator(path);
|
||||
// Ensure we check the same path we save into storages list later.
|
||||
dir = new File(path);
|
||||
|
||||
final boolean isCurrent = path.equals(configPath);
|
||||
final long totalSize = dir.getTotalSpace();
|
||||
final long freeSize = dir.getUsableSpace();
|
||||
|
@ -173,7 +174,7 @@ public class StoragePathManager
|
|||
{
|
||||
// Thrown if the dir is not a valid storage device.
|
||||
// https://github.com/organicmaps/organicmaps/issues/538
|
||||
LOGGER.w(TAG, "External storage checks failed for " + commentedPath);
|
||||
Logger.w(TAG, "External storage checks failed for " + commentedPath);
|
||||
}
|
||||
|
||||
// Get additional storage information for Android 7+.
|
||||
|
@ -191,32 +192,37 @@ public class StoragePathManager
|
|||
(!TextUtils.isEmpty(label) ? ", label='" + label + "'" : "");
|
||||
}
|
||||
else
|
||||
LOGGER.w(TAG, "Can't get StorageVolume for " + commentedPath);
|
||||
Logger.w(TAG, "Can't get StorageVolume for " + commentedPath);
|
||||
}
|
||||
else
|
||||
LOGGER.w(TAG, "Can't get StorageManager for " + commentedPath);
|
||||
Logger.w(TAG, "Can't get StorageManager for " + commentedPath);
|
||||
}
|
||||
}
|
||||
|
||||
if (state != null && !Environment.MEDIA_MOUNTED.equals(state)
|
||||
&& !Environment.MEDIA_MOUNTED_READ_ONLY.equals(state))
|
||||
{
|
||||
LOGGER.w(TAG, "Not mounted: " + commentedPath);
|
||||
Logger.w(TAG, "Not mounted: " + commentedPath);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dir.exists())
|
||||
{
|
||||
LOGGER.w(TAG, "Not exists: " + commentedPath);
|
||||
Logger.w(TAG, "Not exists: " + commentedPath);
|
||||
return;
|
||||
}
|
||||
if (!dir.isDirectory())
|
||||
{
|
||||
LOGGER.w(TAG, "Not a directory: " + commentedPath);
|
||||
Logger.w(TAG, "Not a directory: " + commentedPath);
|
||||
return;
|
||||
}
|
||||
if (!dir.canWrite() || Environment.MEDIA_MOUNTED_READ_ONLY.equals(state))
|
||||
|
||||
// For writability check use a test dir creation instead of canWrite() to get more information
|
||||
// and avoid possible false negatives.
|
||||
if (!StorageUtils.isDirWritable(dir))
|
||||
{
|
||||
if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state))
|
||||
Logger.w(TAG, "Mounted read-only: " + commentedPath);
|
||||
isReadonly = true;
|
||||
commentedPath = "read-only " + commentedPath;
|
||||
}
|
||||
|
@ -233,7 +239,7 @@ public class StoragePathManager
|
|||
mCurrentStorageIndex = mStorages.size() - 1;
|
||||
if (isInternal)
|
||||
mInternalStorage = storage;
|
||||
LOGGER.i(TAG, "Accepted " + commentedPath);
|
||||
Logger.i(TAG, "Accepted " + commentedPath);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -243,9 +249,9 @@ public class StoragePathManager
|
|||
{
|
||||
// Current configured storage directory, can be empty on the first run.
|
||||
final String configPath = Config.getStoragePath();
|
||||
LOGGER.i(TAG, "Currently configured storage: " + (TextUtils.isEmpty(configPath) ? "N/A" : configPath));
|
||||
Logger.i(TAG, "Currently configured storage: " + (TextUtils.isEmpty(configPath) ? "N/A" : configPath));
|
||||
|
||||
LOGGER.i(TAG, "Begin scanning storages");
|
||||
Logger.i(TAG, "Begin scanning storages");
|
||||
mStorages.clear();
|
||||
mCurrentStorageIndex = -1;
|
||||
mInternalStorage = null;
|
||||
|
@ -259,7 +265,7 @@ public class StoragePathManager
|
|||
File internalDir = mContext.getFilesDir();
|
||||
addStorageOption(internalDir, true, configPath);
|
||||
|
||||
LOGGER.i(TAG, "End scanning storages");
|
||||
Logger.i(TAG, "End scanning storages");
|
||||
|
||||
if (mStorages.isEmpty())
|
||||
// Shut down the app.
|
||||
|
@ -267,7 +273,7 @@ public class StoragePathManager
|
|||
|
||||
if (!TextUtils.isEmpty(configPath) && mCurrentStorageIndex == -1)
|
||||
{
|
||||
LOGGER.w(TAG, "Currently configured storage is not available!");
|
||||
Logger.w(TAG, "Currently configured storage is not available!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -314,16 +320,16 @@ public class StoragePathManager
|
|||
path = storages.get(currentIdx).mPath;
|
||||
if (containsMapData(path))
|
||||
{
|
||||
LOGGER.i(TAG, "Found map files at the currently configured " + path);
|
||||
Logger.i(TAG, "Found map files at the currently configured " + path);
|
||||
return path;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.w(TAG, "No map files found at the currenly configured " + path);
|
||||
Logger.w(TAG, "No map files found at the currenly configured " + path);
|
||||
}
|
||||
}
|
||||
|
||||
LOGGER.i(TAG, "Looking for map files in available storages...");
|
||||
Logger.i(TAG, "Looking for map files in available storages...");
|
||||
for (int idx = 0; idx < storages.size(); ++idx)
|
||||
{
|
||||
if (idx == currentIdx)
|
||||
|
@ -331,17 +337,17 @@ public class StoragePathManager
|
|||
path = storages.get(idx).mPath;
|
||||
if (containsMapData(path))
|
||||
{
|
||||
LOGGER.i(TAG, "Found map files at " + path);
|
||||
Logger.i(TAG, "Found map files at " + path);
|
||||
return path;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.i(TAG, "No map files found at " + path);
|
||||
Logger.i(TAG, "No map files found at " + path);
|
||||
}
|
||||
}
|
||||
|
||||
path = mgr.getDefaultStorage().mPath;
|
||||
LOGGER.i(TAG, "Using default storage " + path);
|
||||
Logger.i(TAG, "Using default storage " + path);
|
||||
return path;
|
||||
}
|
||||
|
||||
|
@ -351,7 +357,7 @@ public class StoragePathManager
|
|||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
public static boolean moveStorage(@NonNull final String newPath, @NonNull final String oldPath)
|
||||
{
|
||||
LOGGER.i(TAG, "Begin moving maps from " + oldPath + " to " + newPath);
|
||||
Logger.i(TAG, "Begin moving maps from " + oldPath + " to " + newPath);
|
||||
|
||||
final File oldDir = new File(oldPath);
|
||||
final File newDir = new File(newPath);
|
||||
|
@ -369,13 +375,13 @@ public class StoragePathManager
|
|||
|
||||
for (int i = 0; i < oldFiles.length; ++i)
|
||||
{
|
||||
LOGGER.i(TAG, "Moving " + oldFiles[i].getPath() + " to " + newFiles[i].getPath());
|
||||
Logger.i(TAG, "Moving " + oldFiles[i].getPath() + " to " + newFiles[i].getPath());
|
||||
File parent = newFiles[i].getParentFile();
|
||||
if (parent != null)
|
||||
parent.mkdirs();
|
||||
if (!MapManager.nativeMoveFile(oldFiles[i].getPath(), newFiles[i].getPath()))
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to move " + oldFiles[i].getPath() + " to " + newFiles[i].getPath());
|
||||
Logger.e(TAG, "Failed to move " + oldFiles[i].getPath() + " to " + newFiles[i].getPath());
|
||||
// In the case of failure delete all new files. Old files will
|
||||
// be lost if new files were just moved from old locations.
|
||||
// TODO: Delete old files only after all of them were copied to the new location.
|
||||
|
@ -383,7 +389,7 @@ public class StoragePathManager
|
|||
return false;
|
||||
}
|
||||
}
|
||||
LOGGER.i(TAG, "End moving maps");
|
||||
Logger.i(TAG, "End moving maps");
|
||||
|
||||
UiThread.run(() -> Framework.nativeSetWritableDir(newPath));
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ import android.text.TextUtils;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
import com.mapswithme.maps.R;
|
||||
|
@ -18,7 +17,6 @@ import com.mapswithme.maps.base.Initializable;
|
|||
import com.mapswithme.maps.base.MediaPlayerWrapper;
|
||||
import com.mapswithme.util.Config;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -43,7 +41,6 @@ public enum TtsPlayer implements Initializable<Context>
|
|||
{
|
||||
INSTANCE;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = TtsPlayer.class.getSimpleName();
|
||||
private static final Locale DEFAULT_LOCALE = Locale.US;
|
||||
private static final float SPEECH_RATE = 1.2f;
|
||||
|
@ -152,7 +149,7 @@ public enum TtsPlayer implements Initializable<Context>
|
|||
mTts = new TextToSpeech(context, status -> {
|
||||
if (status == TextToSpeech.ERROR)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to initialize TextToSpeach");
|
||||
Logger.e(TAG, "Failed to initialize TextToSpeach");
|
||||
lockDown();
|
||||
mInitializing = false;
|
||||
return;
|
||||
|
@ -273,11 +270,11 @@ public enum TtsPlayer implements Initializable<Context>
|
|||
outList.add(new LanguageData(codes[i], names[i], mTts));
|
||||
}
|
||||
catch (LanguageData.NotAvailableException ignored) {
|
||||
LOGGER.e(TAG, "Failed to get usable languages " + ignored.getMessage());
|
||||
Logger.w(TAG, "Failed to get usable languages " + ignored.getMessage());
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to get usable languages", e);
|
||||
Logger.e(TAG, "Failed to get usable languages", e);
|
||||
lockDown();
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
|
||||
package androidx.core.widget;
|
||||
|
||||
import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
|
@ -27,7 +25,6 @@ import android.os.Bundle;
|
|||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.FocusFinder;
|
||||
import android.view.KeyEvent;
|
||||
|
@ -57,9 +54,12 @@ import androidx.core.view.ScrollingView;
|
|||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
|
||||
import androidx.core.view.accessibility.AccessibilityRecordCompat;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP;
|
||||
|
||||
/**
|
||||
* NestedScrollViewClickFixed is just like {@link android.widget.ScrollView}, but it supports acting
|
||||
* as both a nested scrolling parent and child on both new and old versions of Android.
|
||||
|
@ -67,12 +67,11 @@ import java.util.List;
|
|||
*/
|
||||
public class NestedScrollViewClickFixed extends FrameLayout implements NestedScrollingParent2,
|
||||
NestedScrollingChild2, ScrollingView {
|
||||
private static final String TAG = NestedScrollViewClickFixed.class.getSimpleName();
|
||||
static final int ANIMATED_SCROLL_GAP = 250;
|
||||
|
||||
static final float MAX_SCROLL_FACTOR = 0.5f;
|
||||
|
||||
private static final String TAG = "NestedScrollViewClickFixed";
|
||||
|
||||
/**
|
||||
* Interface definition for a callback to be invoked when the scroll
|
||||
* X or Y positions of a view change.
|
||||
|
@ -719,8 +718,7 @@ public class NestedScrollViewClickFixed extends FrameLayout implements NestedScr
|
|||
|
||||
final int pointerIndex = ev.findPointerIndex(activePointerId);
|
||||
if (pointerIndex == -1) {
|
||||
Log.e(TAG, "Invalid pointerId=" + activePointerId
|
||||
+ " in onInterceptTouchEvent");
|
||||
Logger.e(TAG, "Invalid pointerId=" + activePointerId + " in onInterceptTouchEvent");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -835,7 +833,7 @@ public class NestedScrollViewClickFixed extends FrameLayout implements NestedScr
|
|||
case MotionEvent.ACTION_MOVE:
|
||||
final int activePointerIndex = ev.findPointerIndex(mActivePointerId);
|
||||
if (activePointerIndex == -1) {
|
||||
Log.e(TAG, "Invalid pointerId=" + mActivePointerId + " in onTouchEvent");
|
||||
Logger.e(TAG, "Invalid pointerId=" + mActivePointerId + " in onTouchEvent");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ public class SearchToolbarController extends ToolbarController implements View.O
|
|||
private final View mBack;
|
||||
@NonNull
|
||||
private final EditText mQuery;
|
||||
private boolean mFromCategory = false;
|
||||
@NonNull
|
||||
private final View mProgress;
|
||||
@NonNull
|
||||
|
@ -157,13 +158,16 @@ public class SearchToolbarController extends ToolbarController implements View.O
|
|||
{
|
||||
return (UiUtils.isVisible(mSearchContainer) ? mQuery.getText().toString() : "");
|
||||
}
|
||||
public boolean isCategory() { return mFromCategory; }
|
||||
|
||||
public void setQuery(CharSequence query)
|
||||
public void setQuery(CharSequence query, boolean fromCategory)
|
||||
{
|
||||
mFromCategory = fromCategory;
|
||||
mQuery.setText(query);
|
||||
if (!TextUtils.isEmpty(query))
|
||||
mQuery.setSelection(query.length());
|
||||
}
|
||||
public void setQuery(CharSequence query) { setQuery(query, false); }
|
||||
|
||||
public void clear()
|
||||
{
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
package com.mapswithme.maps.widget.placepage;
|
||||
|
||||
import static com.mapswithme.maps.widget.placepage.PlacePageUtils.isAnchoredState;
|
||||
import static com.mapswithme.maps.widget.placepage.PlacePageUtils.isExpandedState;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
import com.trafi.anchorbottomsheetbehavior.AnchorBottomSheetBehavior;
|
||||
|
||||
import static com.mapswithme.maps.widget.placepage.PlacePageUtils.isAnchoredState;
|
||||
import static com.mapswithme.maps.widget.placepage.PlacePageUtils.isExpandedState;
|
||||
|
||||
public class DefaultBottomSheetCallback extends AnchorBottomSheetBehavior.BottomSheetCallback
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = DefaultBottomSheetCallback.class.getSimpleName();
|
||||
@NonNull
|
||||
private final BottomSheetChangedListener mSheetChangedListener;
|
||||
|
@ -26,8 +23,8 @@ public class DefaultBottomSheetCallback extends AnchorBottomSheetBehavior.Bottom
|
|||
@Override
|
||||
public void onStateChanged(@NonNull View bottomSheet, int oldState, int newState)
|
||||
{
|
||||
LOGGER.d(TAG, "State change, new = " + PlacePageUtils.toString(newState)
|
||||
+ " old = " + PlacePageUtils.toString(oldState));
|
||||
Logger.d(TAG, "State change, new = " + PlacePageUtils.toString(newState) +
|
||||
" old = " + PlacePageUtils.toString(oldState));
|
||||
if (PlacePageUtils.isSettlingState(newState) || PlacePageUtils.isDraggingState(newState))
|
||||
{
|
||||
return;
|
||||
|
|
|
@ -32,7 +32,6 @@ import androidx.appcompat.widget.Toolbar;
|
|||
import androidx.core.widget.NestedScrollViewClickFixed;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.MwmActivity;
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
|
@ -65,7 +64,6 @@ import com.mapswithme.util.UiUtils;
|
|||
import com.mapswithme.util.Utils;
|
||||
import com.mapswithme.util.concurrency.UiThread;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -80,8 +78,8 @@ public class PlacePageView extends NestedScrollViewClickFixed
|
|||
EditBookmarkFragment.EditBookmarkListener
|
||||
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = PlacePageView.class.getSimpleName();
|
||||
|
||||
private static final String PREF_COORDINATES_FORMAT = "coordinates_format";
|
||||
private static final List<CoordinatesFormat> visibleCoordsFormat =
|
||||
Arrays.asList(CoordinatesFormat.LatLonDMS,
|
||||
|
@ -506,7 +504,7 @@ public class PlacePageView extends NestedScrollViewClickFixed
|
|||
{
|
||||
if (mMapObject == null)
|
||||
{
|
||||
LOGGER.e(TAG, "Bookmark cannot be managed, mMapObject is null!");
|
||||
Logger.e(TAG, "Bookmark cannot be managed, mMapObject is null!");
|
||||
return;
|
||||
}
|
||||
toggleIsBookmark(mMapObject);
|
||||
|
@ -516,7 +514,7 @@ public class PlacePageView extends NestedScrollViewClickFixed
|
|||
{
|
||||
if (mMapObject == null)
|
||||
{
|
||||
LOGGER.e(TAG, "A map object cannot be shared, it's null!");
|
||||
Logger.e(TAG, "A map object cannot be shared, it's null!");
|
||||
return;
|
||||
}
|
||||
SharingUtils.shareMapObject(getContext(), mMapObject);
|
||||
|
@ -526,7 +524,7 @@ public class PlacePageView extends NestedScrollViewClickFixed
|
|||
{
|
||||
if (mMapObject == null)
|
||||
{
|
||||
LOGGER.e(TAG, "A mwm request cannot be handled, mMapObject is null!");
|
||||
Logger.e(TAG, "A mwm request cannot be handled, mMapObject is null!");
|
||||
getActivity().finish();
|
||||
return;
|
||||
}
|
||||
|
@ -746,7 +744,7 @@ public class PlacePageView extends NestedScrollViewClickFixed
|
|||
{
|
||||
if (mMapObject == null)
|
||||
{
|
||||
LOGGER.e(TAG, "A place page views cannot be refreshed, mMapObject is null");
|
||||
Logger.e(TAG, "A place page views cannot be refreshed, mMapObject is null");
|
||||
return;
|
||||
}
|
||||
refreshPreview(mMapObject);
|
||||
|
@ -1181,7 +1179,7 @@ public class PlacePageView extends NestedScrollViewClickFixed
|
|||
if (mMapObject == null)
|
||||
{
|
||||
// TODO: This method is constantly called even when nothing is selected on the map.
|
||||
//LOGGER.e(TAG, "A location cannot be refreshed, mMapObject is null!");
|
||||
//Logger.e(TAG, "A location cannot be refreshed, mMapObject is null!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1297,7 +1295,7 @@ public class PlacePageView extends NestedScrollViewClickFixed
|
|||
case R.id.ll__place_editor:
|
||||
if (mMapObject == null)
|
||||
{
|
||||
LOGGER.e(TAG, "Cannot start editor, map object is null!");
|
||||
Logger.e(TAG, "Cannot start editor, map object is null!");
|
||||
break;
|
||||
}
|
||||
getActivity().showEditor();
|
||||
|
@ -1314,7 +1312,7 @@ public class PlacePageView extends NestedScrollViewClickFixed
|
|||
MwmApplication.prefs(getContext()).edit().putInt(PREF_COORDINATES_FORMAT, mCoordsFormat.getId()).apply();
|
||||
if (mMapObject == null)
|
||||
{
|
||||
LOGGER.e(TAG, "A LatLon cannot be refreshed, mMapObject is null");
|
||||
Logger.e(TAG, "A LatLon cannot be refreshed, mMapObject is null");
|
||||
break;
|
||||
}
|
||||
refreshLatLon(mMapObject);
|
||||
|
@ -1349,7 +1347,7 @@ public class PlacePageView extends NestedScrollViewClickFixed
|
|||
// TODO: Refactor and use separate getters for Wiki and all other PP meta info too.
|
||||
if (mMapObject == null)
|
||||
{
|
||||
LOGGER.e(TAG, "Cannot follow url, mMapObject is null!");
|
||||
Logger.e(TAG, "Cannot follow url, mMapObject is null!");
|
||||
break;
|
||||
}
|
||||
Utils.openUrl(getContext(), mMapObject.getMetadata(Metadata.MetadataType.FMD_WIKIPEDIA));
|
||||
|
@ -1382,8 +1380,6 @@ public class PlacePageView extends NestedScrollViewClickFixed
|
|||
@Override
|
||||
public boolean onLongClick(View v)
|
||||
{
|
||||
final Object tag = v.getTag();
|
||||
|
||||
final List<String> items = new ArrayList<>();
|
||||
switch (v.getId())
|
||||
{
|
||||
|
@ -1405,7 +1401,7 @@ public class PlacePageView extends NestedScrollViewClickFixed
|
|||
case R.id.ll__place_latlon:
|
||||
if (mMapObject == null)
|
||||
{
|
||||
LOGGER.e(TAG, "A long click tap on LatLon cannot be handled, mMapObject is null!");
|
||||
Logger.e(TAG, "A long click tap on LatLon cannot be handled, mMapObject is null!");
|
||||
break;
|
||||
}
|
||||
final double lat = mMapObject.getLat();
|
||||
|
@ -1610,7 +1606,7 @@ public class PlacePageView extends NestedScrollViewClickFixed
|
|||
{
|
||||
if (mMapObject == null)
|
||||
{
|
||||
LOGGER.e(TAG, "A bookmark cannot be edited, mMapObject is null!");
|
||||
Logger.e(TAG, "A bookmark cannot be edited, mMapObject is null!");
|
||||
return;
|
||||
}
|
||||
Bookmark bookmark = (Bookmark) mMapObject;
|
||||
|
|
|
@ -71,7 +71,7 @@ public class PlacePhoneAdapter extends RecyclerView.Adapter<PlacePhoneAdapter.Vi
|
|||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnLongClickListener
|
||||
{
|
||||
private TextView mPhone;
|
||||
private final TextView mPhone;
|
||||
|
||||
public ViewHolder(@NonNull View itemView)
|
||||
{
|
||||
|
|
|
@ -7,14 +7,12 @@ import android.app.Activity;
|
|||
import android.content.res.Resources;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.view.GestureDetectorCompat;
|
||||
|
||||
import com.mapswithme.maps.Framework;
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.maps.bookmarks.data.MapObject;
|
||||
|
@ -22,7 +20,6 @@ import com.mapswithme.maps.location.LocationHelper;
|
|||
import com.mapswithme.maps.location.LocationListener;
|
||||
import com.mapswithme.util.UiUtils;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
import com.trafi.anchorbottomsheetbehavior.AnchorBottomSheetBehavior;
|
||||
|
||||
import java.util.Objects;
|
||||
|
@ -31,10 +28,10 @@ public class RichPlacePageController implements PlacePageController, LocationLis
|
|||
View.OnLayoutChangeListener,
|
||||
Closable
|
||||
{
|
||||
private static final String TAG = RichPlacePageController.class.getSimpleName();
|
||||
|
||||
private static final float ANCHOR_RATIO = 0.3f;
|
||||
private static final float PREVIEW_PLUS_RATIO = 0.45f;
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = RichPlacePageController.class.getSimpleName();
|
||||
private static final int ANIM_CHANGE_PEEK_HEIGHT_MS = 100;
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@NonNull
|
||||
|
@ -184,7 +181,7 @@ public class RichPlacePageController implements PlacePageController, LocationLis
|
|||
{
|
||||
if (mPeekHeightAnimating)
|
||||
{
|
||||
Log.d(TAG, "Peek animation in progress, ignore.");
|
||||
Logger.d(TAG, "Peek animation in progress, ignore.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -196,7 +193,7 @@ public class RichPlacePageController implements PlacePageController, LocationLis
|
|||
int currentState = mPlacePageBehavior.getState();
|
||||
if (PlacePageUtils.isSettlingState(currentState) || PlacePageUtils.isDraggingState(currentState))
|
||||
{
|
||||
LOGGER.d(TAG, "Sheet state inappropriate, ignore.");
|
||||
Logger.d(TAG, "Sheet state inappropriate, ignore.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -313,7 +310,7 @@ public class RichPlacePageController implements PlacePageController, LocationLis
|
|||
{
|
||||
if (mPlacePageBehavior.getPeekHeight() == 0)
|
||||
{
|
||||
LOGGER.d(TAG, "Layout change ignored, peek height not calculated yet");
|
||||
Logger.d(TAG, "Layout change ignored, peek height not calculated yet");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ public final class Constants
|
|||
|
||||
public static class Email
|
||||
{
|
||||
public static final String FEEDBACK = "android@organicmaps.app";
|
||||
public static final String SUPPORT = BuildConfig.SUPPORT_MAIL;
|
||||
public static final String RATING = "rating@organicmaps.app";
|
||||
|
||||
|
|
|
@ -5,20 +5,18 @@ import android.content.Context;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.work.Worker;
|
||||
import androidx.work.WorkerParameters;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Objects;
|
||||
|
||||
public class FileUploadWorker extends Worker
|
||||
{
|
||||
static final String PARAMS = "params";
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.NETWORK);
|
||||
private static final String TAG = FileUploadWorker.class.getSimpleName();
|
||||
|
||||
static final String PARAMS = "params";
|
||||
|
||||
public FileUploadWorker(@NonNull Context context, @NonNull WorkerParameters workerParams)
|
||||
{
|
||||
super(context, workerParams);
|
||||
|
@ -32,7 +30,7 @@ public class FileUploadWorker extends Worker
|
|||
|
||||
Gson gson = new Gson();
|
||||
HttpPayload payload = gson.fromJson(rawJson, HttpPayload.class);
|
||||
LOGGER.d(TAG, "Payload '" + payload + "' going to be uploaded");
|
||||
Logger.d(TAG, "Payload '" + payload + "' going to be uploaded");
|
||||
|
||||
File file = new File(payload.getFilePath());
|
||||
if (!file.exists())
|
||||
|
@ -40,13 +38,13 @@ public class FileUploadWorker extends Worker
|
|||
|
||||
HttpUploader uploader = new HttpUploader(payload);
|
||||
HttpUploader.Result result = uploader.upload();
|
||||
LOGGER.d(TAG, "Upload finished with result '" + result + "' ");
|
||||
Logger.d(TAG, "Upload finished with result '" + result + "' ");
|
||||
|
||||
if (result.getHttpCode() / 100 != 2)
|
||||
return Result.retry();
|
||||
|
||||
boolean isDeleted = file.delete();
|
||||
LOGGER.d(TAG, "File deleted: " + isDeleted + " " + payload.getFilePath());
|
||||
Logger.d(TAG, "File deleted: " + isDeleted + " " + payload.getFilePath());
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,14 +6,11 @@ import androidx.work.Data;
|
|||
import androidx.work.NetworkType;
|
||||
import androidx.work.OneTimeWorkRequest;
|
||||
import androidx.work.WorkManager;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
public class HttpBackgroundUploader extends AbstractHttpUploader
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.NETWORK);
|
||||
private static final String TAG = HttpBackgroundUploader.class.getSimpleName();
|
||||
|
||||
public HttpBackgroundUploader(@NonNull HttpPayload payload)
|
||||
|
@ -32,7 +29,7 @@ public class HttpBackgroundUploader extends AbstractHttpUploader
|
|||
OneTimeWorkRequest request = new OneTimeWorkRequest.Builder(FileUploadWorker.class)
|
||||
.setConstraints(constraints)
|
||||
.setInputData(builder.build()).build();
|
||||
LOGGER.d(TAG, "Request " + request + "' going to be enqueued");
|
||||
Logger.d(TAG, "Request " + request + "' going to be enqueued");
|
||||
WorkManager.getInstance().enqueue(request);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,9 +27,7 @@ package com.mapswithme.util;
|
|||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
|
@ -51,11 +49,11 @@ import java.util.zip.InflaterInputStream;
|
|||
|
||||
public final class HttpClient
|
||||
{
|
||||
private static final String TAG = HttpClient.class.getSimpleName();
|
||||
|
||||
public static final String HEADER_AUTHORIZATION = "Authorization";
|
||||
private final static String TAG = HttpClient.class.getSimpleName();
|
||||
// TODO(AlexZ): tune for larger files
|
||||
private final static int STREAM_BUFFER_SIZE = 1024 * 64;
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.NETWORK);
|
||||
|
||||
public static Params run(@NonNull final Params p) throws IOException, NullPointerException
|
||||
{
|
||||
|
@ -64,7 +62,7 @@ public final class HttpClient
|
|||
|
||||
HttpURLConnection connection = null;
|
||||
|
||||
LOGGER.d(TAG, "Connecting to " + Utils.makeUrlSafe(p.url));
|
||||
Logger.d(TAG, "Connecting to " + Utils.makeUrlSafe(p.url));
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -121,7 +119,7 @@ public final class HttpClient
|
|||
{
|
||||
os.close();
|
||||
}
|
||||
LOGGER.d(TAG, "Sent " + p.httpMethod + " with content of size " + p.data.length);
|
||||
Logger.d(TAG, "Sent " + p.httpMethod + " with content of size " + p.data.length);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -137,13 +135,13 @@ public final class HttpClient
|
|||
}
|
||||
istream.close(); // IOException
|
||||
ostream.close(); // IOException
|
||||
LOGGER.d(TAG, "Sent " + p.httpMethod + " with file of size " + file.length());
|
||||
Logger.d(TAG, "Sent " + p.httpMethod + " with file of size " + file.length());
|
||||
}
|
||||
}
|
||||
// GET data from the server or receive response body
|
||||
p.httpResponseCode = connection.getResponseCode();
|
||||
LOGGER.d(TAG, "Received HTTP " + p.httpResponseCode + " from server, content encoding = "
|
||||
+ connection.getContentEncoding() + ", for request = " + Utils.makeUrlSafe(p.url));
|
||||
Logger.d(TAG, "Received HTTP " + p.httpResponseCode + " from server, content encoding = " +
|
||||
connection.getContentEncoding() + ", for request = " + Utils.makeUrlSafe(p.url));
|
||||
|
||||
if (p.httpResponseCode >= 300 && p.httpResponseCode < 400)
|
||||
p.receivedUrl = connection.getHeaderField("Location");
|
||||
|
|
|
@ -6,10 +6,10 @@ import android.util.Base64;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
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;
|
||||
|
@ -24,13 +24,10 @@ 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
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.NETWORK);
|
||||
private static final String TAG = HttpUploader.class.getSimpleName();
|
||||
|
||||
private static final String LINE_FEED = "\r\n";
|
||||
private static final String CHARSET = "UTF-8";
|
||||
private static final int BUFFER = 8192;
|
||||
|
@ -85,8 +82,7 @@ public final class HttpUploader extends AbstractHttpUploader
|
|||
setStreamingMode(connection, bodyLength);
|
||||
setHeaders(connection, bodyLength);
|
||||
long startTime = System.currentTimeMillis();
|
||||
LOGGER.d(
|
||||
TAG, "Start bookmarks upload on url: '" + Utils.makeUrlSafe(getPayload().getUrl()) + "'");
|
||||
Logger.d(TAG, "Start bookmarks upload on url: '" + Utils.makeUrlSafe(getPayload().getUrl()) + "'");
|
||||
OutputStream outputStream = connection.getOutputStream();
|
||||
writer = new PrintWriter(new OutputStreamWriter(outputStream, CHARSET));
|
||||
writeParams(writer, paramsBuilder);
|
||||
|
@ -94,12 +90,12 @@ public final class HttpUploader extends AbstractHttpUploader
|
|||
writeEndPart(writer);
|
||||
|
||||
status = connection.getResponseCode();
|
||||
LOGGER.d(TAG, "Upload bookmarks status code: " + status);
|
||||
Logger.d(TAG, "Upload bookmarks status code: " + status);
|
||||
reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||
message = readResponse(reader);
|
||||
long duration = (System.currentTimeMillis() - startTime) / 1000;
|
||||
LOGGER.d(TAG, "Upload bookmarks response: '" + message + "', " +
|
||||
"duration = " + duration + " sec, body size = " + bodyLength + " bytes.");
|
||||
Logger.d(TAG, "Upload bookmarks response: '" + message + "', " +
|
||||
"duration = " + duration + " sec, body size = " + bodyLength + " bytes.");
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
|
@ -110,7 +106,7 @@ public final class HttpUploader extends AbstractHttpUploader
|
|||
if (!TextUtils.isEmpty(errMsg))
|
||||
message = errMsg;
|
||||
}
|
||||
LOGGER.e(TAG, message, e);
|
||||
Logger.e(TAG, message, e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@ -163,7 +159,7 @@ public final class HttpUploader extends AbstractHttpUploader
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to read a error stream.");
|
||||
Logger.e(TAG, "Failed to read a error stream.");
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.mapswithme.util;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
|
@ -11,15 +9,10 @@ import android.view.Surface;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
public class LocationUtils
|
||||
{
|
||||
private LocationUtils() {}
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.LOCATION);
|
||||
private static final String TAG = LocationUtils.class.getSimpleName();
|
||||
private static final double DEFAULT_SPEED_MPS = 5;
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,20 +5,17 @@ import android.content.SharedPreferences;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
public final class SecureStorage
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = SecureStorage.class.getSimpleName();
|
||||
|
||||
private SecureStorage() {}
|
||||
|
||||
public static void save(@NonNull Context context, @NonNull String key, @NonNull String value)
|
||||
{
|
||||
LOGGER.d(TAG, "save: key = " + key);
|
||||
Logger.d(TAG, "save: key = " + key);
|
||||
SharedPreferences prefs = context.getSharedPreferences("secure", Context.MODE_PRIVATE);
|
||||
prefs.edit().putString(key, value).apply();
|
||||
}
|
||||
|
@ -26,14 +23,14 @@ public final class SecureStorage
|
|||
@Nullable
|
||||
public static String load(@NonNull Context context, @NonNull String key)
|
||||
{
|
||||
LOGGER.d(TAG, "load: key = " + key);
|
||||
Logger.d(TAG, "load: key = " + key);
|
||||
SharedPreferences prefs = context.getSharedPreferences("secure", Context.MODE_PRIVATE);
|
||||
return prefs.getString(key, null);
|
||||
}
|
||||
|
||||
public static void remove(@NonNull Context context, @NonNull String key)
|
||||
{
|
||||
LOGGER.d(TAG, "remove: key = " + key);
|
||||
Logger.d(TAG, "remove: key = " + key);
|
||||
SharedPreferences prefs = context.getSharedPreferences("secure", Context.MODE_PRIVATE);
|
||||
prefs.edit().remove(key).apply();
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ public class SharingUtils
|
|||
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
|
||||
|
||||
final String text = context.getString(R.string.share_bookmarks_email_body);
|
||||
intent.putExtra(Intent.EXTRA_TEXT, text.toString());
|
||||
intent.putExtra(Intent.EXTRA_TEXT, text);
|
||||
|
||||
final Uri fileUri = StorageUtils.getUriForFilePath(context, fileName);
|
||||
intent.putExtra(android.content.Intent.EXTRA_STREAM, fileUri);
|
||||
|
|
|
@ -6,18 +6,13 @@ import android.content.Context;
|
|||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Environment;
|
||||
import android.provider.DocumentsContract;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.FileProvider;
|
||||
|
||||
import com.mapswithme.maps.BuildConfig;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -34,77 +29,43 @@ import java.util.concurrent.LinkedBlockingQueue;
|
|||
|
||||
public class StorageUtils
|
||||
{
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.STORAGE);
|
||||
private final static String TAG = StorageUtils.class.getSimpleName();
|
||||
private final static String LOGS_FOLDER = "logs";
|
||||
private static final String TAG = StorageUtils.class.getSimpleName();
|
||||
|
||||
/**
|
||||
* Checks if external storage is available for read and write
|
||||
*
|
||||
* @return true if external storage is mounted and ready for reading/writing
|
||||
*/
|
||||
private static boolean isExternalStorageWritable()
|
||||
public static boolean isDirWritable(File dir)
|
||||
{
|
||||
String state = Environment.getExternalStorageState();
|
||||
return Environment.MEDIA_MOUNTED.equals(state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Safely returns the external files directory path with the preliminary
|
||||
* checking the availability of the mentioned directory
|
||||
*
|
||||
* @return the absolute path of external files directory or null if directory can not be obtained
|
||||
* @see Context#getExternalFilesDir(String)
|
||||
*/
|
||||
@Nullable
|
||||
private static String getExternalFilesDir(@NonNull Application application)
|
||||
{
|
||||
if (!isExternalStorageWritable())
|
||||
return null;
|
||||
|
||||
File dir = application.getExternalFilesDir(null);
|
||||
if (dir != null)
|
||||
return dir.getAbsolutePath();
|
||||
|
||||
Log.e(StorageUtils.class.getSimpleName(),
|
||||
"Cannot get the external files directory for some reasons", new Throwable());
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check existence of the folder for writing the logs. If that folder is absent this method will
|
||||
* try to create it and all missed parent folders.
|
||||
* @return true - if folder exists, otherwise - false
|
||||
*/
|
||||
public static boolean ensureLogsFolderExistence(@NonNull Application application)
|
||||
{
|
||||
String externalDir = StorageUtils.getExternalFilesDir(application);
|
||||
if (TextUtils.isEmpty(externalDir))
|
||||
final String path = dir.getPath();
|
||||
Logger.d(TAG, "Checking for writability " + path);
|
||||
if (!dir.isDirectory())
|
||||
{
|
||||
Logger.w(TAG, "Not a directory: " + path);
|
||||
return false;
|
||||
}
|
||||
|
||||
File folder = new File(externalDir + File.separator + LOGS_FOLDER);
|
||||
boolean success = true;
|
||||
if (!folder.exists())
|
||||
success = folder.mkdirs();
|
||||
return success;
|
||||
}
|
||||
// Extra logging to facilitate debugging writability issues,
|
||||
// e.g. https://github.com/organicmaps/organicmaps/issues/2684
|
||||
if (!dir.exists())
|
||||
Logger.w(TAG, "Not exists: " + path);
|
||||
if (!dir.canWrite())
|
||||
Logger.w(TAG, "Not writable: " + path);
|
||||
if (!dir.canRead())
|
||||
Logger.w(TAG, "Not readable: " + path);
|
||||
if (dir.list() == null)
|
||||
Logger.w(TAG, "Not listable: " + path);
|
||||
|
||||
@Nullable
|
||||
public static String getLogsFolder(@NonNull Application application)
|
||||
{
|
||||
if (!ensureLogsFolderExistence(application))
|
||||
return null;
|
||||
final File newDir = new File(dir, "om_test_dir");
|
||||
final String newPath = newDir.getPath();
|
||||
if (!newDir.mkdir())
|
||||
Logger.w(TAG, "Failed to create the test dir: " + newPath);
|
||||
if (!newDir.exists())
|
||||
{
|
||||
Logger.w(TAG, "The test dir doesn't exist: " + newPath);
|
||||
return false;
|
||||
}
|
||||
|
||||
String externalDir = StorageUtils.getExternalFilesDir(application);
|
||||
return externalDir + File.separator + LOGS_FOLDER;
|
||||
}
|
||||
if (!newDir.delete())
|
||||
Logger.w(TAG, "Failed to delete the test dir: " + newPath);
|
||||
|
||||
@Nullable
|
||||
static String getLogsZipPath(@NonNull Application application)
|
||||
{
|
||||
String zipFile = getExternalFilesDir(application) + File.separator + LOGS_FOLDER + ".zip";
|
||||
File file = new File(zipFile);
|
||||
return file.isFile() && file.exists() ? zipFile : null;
|
||||
return true;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
@ -117,7 +78,7 @@ public class StorageUtils
|
|||
}
|
||||
catch (final PackageManager.NameNotFoundException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Can't get apk path from PackageManager", e);
|
||||
Logger.e(TAG, "Can't get apk path from PackageManager", e);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
@ -148,16 +109,23 @@ public class StorageUtils
|
|||
return addTrailingSeparator(application.getCacheDir().getAbsolutePath());
|
||||
}
|
||||
|
||||
public static void createDirectory(@NonNull String path) throws IOException
|
||||
public static boolean createDirectory(@NonNull final String path)
|
||||
{
|
||||
File directory = new File(path);
|
||||
final File directory = new File(path);
|
||||
if (!directory.exists() && !directory.mkdirs())
|
||||
{
|
||||
IOException error = new IOException("Can't create directories for: " + path);
|
||||
LOGGER.e(TAG, "Can't create directories for: " + path);
|
||||
CrashlyticsUtils.INSTANCE.logException(error);
|
||||
throw error;
|
||||
final String errMsg = "Can't create directory " + path;
|
||||
Logger.e(TAG, errMsg);
|
||||
CrashlyticsUtils.INSTANCE.logException(new IOException(errMsg));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void requireDirectory(@Nullable final String path) throws IOException
|
||||
{
|
||||
if (!createDirectory(path))
|
||||
throw new IOException("Can't create directory " + path);
|
||||
}
|
||||
|
||||
static long getFileSize(@NonNull String path)
|
||||
|
@ -175,7 +143,7 @@ public class StorageUtils
|
|||
|
||||
/**
|
||||
* Copy data from a URI into a local file.
|
||||
* @param resolve content resolver
|
||||
* @param resolver content resolver
|
||||
* @param from a source URI.
|
||||
* @param to a destination file
|
||||
* @return true on success and false if the provider recently crashed.
|
||||
|
@ -235,7 +203,10 @@ public class StorageUtils
|
|||
{
|
||||
File[] list = dir.listFiles();
|
||||
if (list == null)
|
||||
{
|
||||
Logger.w(TAG, "listFilesRecursively listFiles() returned null for " + dir.getPath());
|
||||
return;
|
||||
}
|
||||
|
||||
for (File file : list)
|
||||
{
|
||||
|
@ -258,7 +229,7 @@ public class StorageUtils
|
|||
final File[] list = dir.listFiles();
|
||||
if (list == null)
|
||||
{
|
||||
LOGGER.w(TAG, "getDirSizeRecursively dirFiles returned null");
|
||||
Logger.w(TAG, "getDirSizeRecursively listFiles() returned null for " + dir.getPath());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -338,7 +309,7 @@ public class StorageUtils
|
|||
final String docId = cur.getString(0);
|
||||
final String name = cur.getString(1);
|
||||
final String mime = cur.getString(2);
|
||||
LOGGER.d(TAG, "docId: " + docId + ", name: " + name + ", mime: " + mime);
|
||||
Logger.d(TAG, "docId: " + docId + ", name: " + name + ", mime: " + mime);
|
||||
|
||||
if (mime.equals(DocumentsContract.Document.MIME_TYPE_DIR))
|
||||
{
|
||||
|
|
|
@ -11,10 +11,10 @@ import android.content.res.Resources;
|
|||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.text.format.DateUtils;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.DateUtils;
|
||||
import android.text.style.AbsoluteSizeSpan;
|
||||
import android.util.AndroidRuntimeException;
|
||||
import android.view.View;
|
||||
|
@ -31,7 +31,6 @@ import androidx.appcompat.app.AlertDialog;
|
|||
import androidx.core.app.NavUtils;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.mapswithme.maps.BuildConfig;
|
||||
import com.mapswithme.maps.MwmApplication;
|
||||
|
@ -39,7 +38,7 @@ import com.mapswithme.maps.R;
|
|||
import com.mapswithme.maps.base.CustomNavigateUpListener;
|
||||
import com.mapswithme.util.concurrency.UiThread;
|
||||
import com.mapswithme.util.log.Logger;
|
||||
import com.mapswithme.util.log.LoggerFactory;
|
||||
import com.mapswithme.util.log.LogsManager;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
@ -56,14 +55,16 @@ import java.util.TimeZone;
|
|||
|
||||
public class Utils
|
||||
{
|
||||
private static final String TAG = Utils.class.getSimpleName();
|
||||
|
||||
@StringRes
|
||||
public static final int INVALID_ID = 0;
|
||||
public static final String UTF_8 = "utf-8";
|
||||
public static final String TEXT_HTML = "text/html; charset=utf-8";
|
||||
private static final Logger LOGGER = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.MISC);
|
||||
private static final String TAG = "Utils";
|
||||
|
||||
private Utils() {}
|
||||
private Utils()
|
||||
{
|
||||
}
|
||||
|
||||
public static boolean isMarshmallowOrLater()
|
||||
{
|
||||
|
@ -227,15 +228,6 @@ public class Utils
|
|||
return Uri.parse(uriString);
|
||||
}
|
||||
|
||||
public static String getFullDeviceModel()
|
||||
{
|
||||
String model = Build.MODEL;
|
||||
if (!model.startsWith(Build.MANUFACTURER))
|
||||
model = Build.MANUFACTURER + " " + model;
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
public static void openAppInMarket(Activity activity, String url)
|
||||
{
|
||||
final Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
||||
|
@ -247,7 +239,7 @@ public class Utils
|
|||
activity.startActivity(marketIntent);
|
||||
} catch (ActivityNotFoundException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to start activity", e);
|
||||
Logger.e(TAG, "Failed to start activity", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -337,22 +329,29 @@ public class Utils
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to close '" + each + "'" , e);
|
||||
Logger.e(TAG, "Failed to close '" + each + "'", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// subject is optional (could be an empty string).
|
||||
|
||||
/**
|
||||
* @param subject could be an empty string
|
||||
*/
|
||||
public static void sendBugReport(@NonNull Activity activity, @NonNull String subject)
|
||||
{
|
||||
LoggerFactory.INSTANCE.zipLogs(new SupportInfoWithLogsCallback(activity, subject,
|
||||
Constants.Email.SUPPORT));
|
||||
subject = "Organic Maps Bugreport" + (TextUtils.isEmpty(subject) ? "" : ": " + subject);
|
||||
LogsManager.INSTANCE.zipLogs(new SupportInfoWithLogsCallback(activity, subject,
|
||||
Constants.Email.SUPPORT));
|
||||
}
|
||||
|
||||
// TODO: Don't send logs with general feedback, send system information only (version, device name, connectivity, etc.)
|
||||
public static void sendFeedback(@NonNull Activity activity)
|
||||
{
|
||||
LoggerFactory.INSTANCE.zipLogs(new SupportInfoWithLogsCallback(activity, "Organic Maps Feedback",
|
||||
Constants.Email.FEEDBACK));
|
||||
LogsManager.INSTANCE.zipLogs(new SupportInfoWithLogsCallback(activity, "Organic Maps Feedback",
|
||||
Constants.Email.SUPPORT));
|
||||
}
|
||||
|
||||
public static void navigateToParent(@Nullable Activity activity)
|
||||
|
@ -451,7 +450,7 @@ public class Utils
|
|||
}
|
||||
catch (ActivityNotFoundException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to call phone", e);
|
||||
Logger.e(TAG, "Failed to call phone", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -463,14 +462,14 @@ public class Utils
|
|||
}
|
||||
catch (ActivityNotFoundException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to open system connection settings", e);
|
||||
Logger.e(TAG, "Failed to open system connection settings", e);
|
||||
try
|
||||
{
|
||||
context.startActivity(new Intent(Settings.ACTION_SETTINGS));
|
||||
}
|
||||
catch (ActivityNotFoundException ex)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to open system settings", ex);
|
||||
Logger.e(TAG, "Failed to open system settings", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -509,7 +508,7 @@ public class Utils
|
|||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to obtain a currency for locale: " + locale, e);
|
||||
Logger.e(TAG, "Failed to obtain a currency for locale: " + locale, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -550,8 +549,8 @@ public class Utils
|
|||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to format string for price = " + price
|
||||
+ " and currencyCode = " + currencyCode, e);
|
||||
Logger.e(TAG, "Failed to format string for price = " + price
|
||||
+ " and currencyCode = " + currencyCode, e);
|
||||
text = (price + " " + currencyCode);
|
||||
}
|
||||
return text;
|
||||
|
@ -566,7 +565,7 @@ public class Utils
|
|||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to obtain currency symbol by currency code = " + currencyCode, e);
|
||||
Logger.e(TAG, "Failed to obtain currency symbol by currency code = " + currencyCode, e);
|
||||
}
|
||||
|
||||
return currencyCode;
|
||||
|
@ -591,7 +590,7 @@ public class Utils
|
|||
}
|
||||
catch (RuntimeException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to get string with id '" + key + "'", e);
|
||||
Logger.e(TAG, "Failed to get string with id '" + key + "'", e);
|
||||
if (BuildConfig.BUILD_TYPE.equals("debug") || BuildConfig.BUILD_TYPE.equals("beta"))
|
||||
{
|
||||
Toast.makeText(context, "Add string id for '" + key + "'!", Toast.LENGTH_LONG).show();
|
||||
|
@ -609,15 +608,13 @@ public class Utils
|
|||
@NonNull
|
||||
public static String getStringValueByKey(@NonNull Context context, @NonNull String key)
|
||||
{
|
||||
@StringRes
|
||||
int id = getStringIdByKey(context, key);
|
||||
try
|
||||
{
|
||||
return context.getString(id);
|
||||
return context.getString(getStringIdByKey(context, key));
|
||||
}
|
||||
catch (Resources.NotFoundException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to get value for string '" + key + "'", e);
|
||||
Logger.e(TAG, "Failed to get value for string '" + key + "'", e);
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
@ -723,19 +720,7 @@ public class Utils
|
|||
@NonNull
|
||||
private static String getLocalizedFeatureByKey(@NonNull Context context, @NonNull String key)
|
||||
{
|
||||
@StringRes
|
||||
int id = getStringIdByKey(context, key);
|
||||
|
||||
try
|
||||
{
|
||||
return context.getString(id);
|
||||
}
|
||||
catch (Resources.NotFoundException e)
|
||||
{
|
||||
LOGGER.e(TAG, "Failed to get localized string for key '" + key + "'", e);
|
||||
}
|
||||
|
||||
return key;
|
||||
return getStringValueByKey(context, key);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
@ -781,7 +766,7 @@ public class Utils
|
|||
return firstChar + string.substring(1).toLowerCase();
|
||||
}
|
||||
|
||||
private static class SupportInfoWithLogsCallback implements LoggerFactory.OnZipCompletedListener
|
||||
private static class SupportInfoWithLogsCallback implements LogsManager.OnZipCompletedListener
|
||||
{
|
||||
@NonNull
|
||||
private final WeakReference<Activity> mActivityRef;
|
||||
|
@ -799,10 +784,11 @@ public class Utils
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onCompleted(final boolean success)
|
||||
public void onCompleted(final boolean success, @Nullable final String zipPath)
|
||||
{
|
||||
//TODO: delete zip file after its sent.
|
||||
UiThread.run(() -> {
|
||||
Activity activity = mActivityRef.get();
|
||||
final Activity activity = mActivityRef.get();
|
||||
if (activity == null)
|
||||
return;
|
||||
|
||||
|
@ -810,21 +796,18 @@ public class Utils
|
|||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { mEmail });
|
||||
intent.putExtra(Intent.EXTRA_SUBJECT, "[" + BuildConfig.VERSION_NAME + "] " + mSubject);
|
||||
// TODO: Send a short text attachment with system info and logs if zipping logs failed
|
||||
if (success)
|
||||
{
|
||||
String logsZipFile = StorageUtils.getLogsZipPath(activity.getApplication());
|
||||
if (!TextUtils.isEmpty(logsZipFile))
|
||||
{
|
||||
Uri uri = StorageUtils.getUriForFilePath(activity, logsZipFile);
|
||||
intent.putExtra(Intent.EXTRA_STREAM, uri);
|
||||
// Properly set permissions for intent, see
|
||||
// https://developer.android.com/reference/androidx/core/content/FileProvider#include-the-permission-in-an-intent
|
||||
intent.setData(uri);
|
||||
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
if (android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||||
intent.setClipData(ClipData.newRawUri("", uri));
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||
}
|
||||
final Uri uri = StorageUtils.getUriForFilePath(activity, zipPath);
|
||||
intent.putExtra(Intent.EXTRA_STREAM, uri);
|
||||
// Properly set permissions for intent, see
|
||||
// https://developer.android.com/reference/androidx/core/content/FileProvider#include-the-permission-in-an-intent
|
||||
intent.setData(uri);
|
||||
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
if (android.os.Build.VERSION.SDK_INT <= android.os.Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||||
intent.setClipData(ClipData.newRawUri("", uri));
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||
}
|
||||
}
|
||||
// Do this so some email clients don't complain about empty body.
|
||||
|
@ -836,7 +819,7 @@ public class Utils
|
|||
}
|
||||
catch (ActivityNotFoundException e)
|
||||
{
|
||||
CrashlyticsUtils.INSTANCE.logException(e);
|
||||
Logger.w(TAG, "No activities found which can handle sending a support message.", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue