Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArsentiy Milchakov <milcars@mapswithme.com>2018-04-05 17:26:47 +0300
committerAleksandr Zatsepin <alexzatsepin@users.noreply.github.com>2018-04-05 17:38:10 +0300
commitc55ab01992c088f2e56caacadd6ad0fcac25d81e (patch)
tree5a3e26af5bb659b209ce47c04809693b6899d4a7 /android/src
parent40d3a51fa986d5e3b392a1fb3960c3d868c2a0c8 (diff)
[android] auth fix
Diffstat (limited to 'android/src')
-rw-r--r--android/src/com/mapswithme/maps/auth/Authorizer.java3
-rw-r--r--android/src/com/mapswithme/maps/auth/PassportAuthDialogFragment.java7
-rw-r--r--android/src/com/mapswithme/maps/bookmarks/data/BookmarkBackupController.java2
-rw-r--r--android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java8
4 files changed, 16 insertions, 4 deletions
diff --git a/android/src/com/mapswithme/maps/auth/Authorizer.java b/android/src/com/mapswithme/maps/auth/Authorizer.java
index c1d81a936a..026794def7 100644
--- a/android/src/com/mapswithme/maps/auth/Authorizer.java
+++ b/android/src/com/mapswithme/maps/auth/Authorizer.java
@@ -9,7 +9,6 @@ import android.support.v4.app.Fragment;
import android.text.TextUtils;
import com.mapswithme.maps.Framework;
-import com.mapswithme.util.ConnectionState;
/**
* An authorizer is responsible for an authorization for the Mapsme server,
@@ -55,7 +54,7 @@ public class Authorizer implements AuthorizationListener
public final void authorize()
{
- if (isAuthorized() || !ConnectionState.isConnected())
+ if (isAuthorized())
{
if (mCallback != null)
mCallback.onAuthorizationFinish(true);
diff --git a/android/src/com/mapswithme/maps/auth/PassportAuthDialogFragment.java b/android/src/com/mapswithme/maps/auth/PassportAuthDialogFragment.java
index f46e7a1b94..82998f9792 100644
--- a/android/src/com/mapswithme/maps/auth/PassportAuthDialogFragment.java
+++ b/android/src/com/mapswithme/maps/auth/PassportAuthDialogFragment.java
@@ -10,6 +10,7 @@ import android.view.View;
import android.view.ViewGroup;
import com.mapswithme.maps.Framework;
+import com.mapswithme.maps.background.Notifier;
import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.util.statistics.Statistics;
@@ -56,11 +57,15 @@ public class PassportAuthDialogFragment extends BaseMwmDialogFragment
mAuthorizer.detach();
}
- private static class AuthCallback implements Authorizer.Callback
+ private class AuthCallback implements Authorizer.Callback
{
@Override
public void onAuthorizationFinish(boolean success)
{
+ dismiss();
+
+ if (success)
+ Notifier.cancelNotification(Notifier.ID_IS_NOT_AUTHENTICATED);
}
@Override
diff --git a/android/src/com/mapswithme/maps/bookmarks/data/BookmarkBackupController.java b/android/src/com/mapswithme/maps/bookmarks/data/BookmarkBackupController.java
index 7aa7cd12e3..ab80f52d0d 100644
--- a/android/src/com/mapswithme/maps/bookmarks/data/BookmarkBackupController.java
+++ b/android/src/com/mapswithme/maps/bookmarks/data/BookmarkBackupController.java
@@ -9,6 +9,7 @@ import android.view.View;
import com.mapswithme.maps.Framework;
import com.mapswithme.maps.R;
import com.mapswithme.maps.auth.Authorizer;
+import com.mapswithme.maps.background.Notifier;
import com.mapswithme.maps.widget.BookmarkBackupView;
import com.mapswithme.util.DateUtils;
import com.mapswithme.util.statistics.Statistics;
@@ -127,6 +128,7 @@ public class BookmarkBackupController implements Authorizer.Callback
{
if (success)
{
+ Notifier.cancelNotification(Notifier.ID_IS_NOT_AUTHENTICATED);
BookmarkManager.INSTANCE.setCloudEnabled(true);
Statistics.INSTANCE.trackEvent(Statistics.EventName.BMK_SYNC_PROPOSAL_ENABLED);
}
diff --git a/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java b/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java
index 216fd44dac..030503dc3a 100644
--- a/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java
+++ b/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java
@@ -13,8 +13,10 @@ import android.widget.EditText;
import com.mapswithme.maps.Framework;
import com.mapswithme.maps.R;
import com.mapswithme.maps.auth.BaseMwmAuthorizationFragment;
+import com.mapswithme.maps.background.Notifier;
import com.mapswithme.maps.bookmarks.data.FeatureId;
import com.mapswithme.maps.widget.ToolbarController;
+import com.mapswithme.util.ConnectionState;
import com.mapswithme.util.Language;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.statistics.Statistics;
@@ -79,7 +81,8 @@ public class UGCEditorFragment extends BaseMwmAuthorizationFragment
submitButton.setOnClickListener(v ->
{
onSubmitButtonClick();
- authorize();
+ if (ConnectionState.isConnected())
+ authorize();
});
}
@@ -100,6 +103,9 @@ public class UGCEditorFragment extends BaseMwmAuthorizationFragment
@Override
public void onAuthorizationFinish(boolean success)
{
+ if (success)
+ Notifier.cancelNotification(Notifier.ID_IS_NOT_AUTHENTICATED);
+
if (isAdded())
getActivity().finish();
}