From f1cdb48a280ef1333491dfa1ebee9d3b6f2710fc Mon Sep 17 00:00:00 2001 From: Hattshire Date: Thu, 1 Feb 2018 02:38:02 -0300 Subject: [PATCH] Show UI on retrieveRtToken() error --- .../org/microg/gms/auth/login/LoginActivity.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/play-services-core/src/main/java/org/microg/gms/auth/login/LoginActivity.java b/play-services-core/src/main/java/org/microg/gms/auth/login/LoginActivity.java index 3b3cdb69..7e50dce2 100644 --- a/play-services-core/src/main/java/org/microg/gms/auth/login/LoginActivity.java +++ b/play-services-core/src/main/java/org/microg/gms/auth/login/LoginActivity.java @@ -144,6 +144,9 @@ public class LoginActivity extends AssistantActivity { state++; if (state == 1) { init(); + } else if (state == -1) { + setResult(RESULT_CANCELED); + finish(); } } @@ -305,11 +308,15 @@ public class LoginActivity extends AssistantActivity { retrieveGmsToken(account); setResult(RESULT_OK); } else { - showError(R.string.auth_general_error_desc); Log.w(TAG, "Account NOT created!"); - setResult(RESULT_CANCELED); - // TODO: Give the user a chance to read the message :) - finish(); + runOnUiThread(new Runnable() { + @Override + public void run() { + showError(R.string.auth_general_error_desc); + setNextButtonText(android.R.string.ok); + } + }); + state = -2; } }