diff --git a/app/build.gradle b/app/build.gradle index f6160ce..53b0175 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,8 +23,8 @@ android { minSdkVersion 21 targetSdkVersion 31 - versionCode 27 - versionName "1.4.2" + versionCode 28 + versionName "1.4.3" signingConfig signingConfigs.release } diff --git a/app/release/app-release.aab b/app/release/app-release.aab index 7f7abe3..0c390d8 100644 Binary files a/app/release/app-release.aab and b/app/release/app-release.aab differ diff --git a/app/src/main/java/dickclock/team/snake/MainActivity.java b/app/src/main/java/dickclock/team/snake/MainActivity.java index 5492ac1..c13e0df 100644 --- a/app/src/main/java/dickclock/team/snake/MainActivity.java +++ b/app/src/main/java/dickclock/team/snake/MainActivity.java @@ -167,17 +167,18 @@ private void switchToFragment(Fragment newFrag) { private void signInSilently() { Log.d(TAG, "signInSilently()"); - - mGoogleSignInClient.silentSignIn().addOnCompleteListener(this, - task -> { - if (task.isSuccessful()) { - Log.d(TAG, "signInSilently(): success"); - onConnected(task.getResult()); - } else { - Log.d(TAG, "signInSilently(): failure"/*, task.getException()*/); - onDisconnected(); - } - }); + try { + mGoogleSignInClient.silentSignIn().addOnCompleteListener(this, + task -> { + if (task.isSuccessful()) { + Log.d(TAG, "signInSilently(): success"); + onConnected(task.getResult()); + } else { + Log.d(TAG, "signInSilently(): failure"/*, task.getException()*/); + onDisconnected(); + } + }); + } catch (Exception ignored) {} } private void startSignInIntent() { try { startActivityForResult(mGoogleSignInClient.getSignInIntent(), RC_SIGN_IN); } catch (Exception ignored) {} } @@ -189,7 +190,6 @@ protected void onResume() { // Since the state of the signed in user can change when the activity is not active // it is recommended to try and sign in silently from when the app resumes. - //TODO for release: try { signInSilently(); } catch (Exception ignored) {} @@ -208,14 +208,15 @@ private void signOut() { Log.w(TAG, "signOut() called, but was not signed in!"); return; } + try { + mGoogleSignInClient.signOut().addOnCompleteListener(this, + task -> { + boolean successful = task.isSuccessful(); + Log.d(TAG, "signOut(): " + (successful ? "success" : "failed")); - mGoogleSignInClient.signOut().addOnCompleteListener(this, - task -> { - boolean successful = task.isSuccessful(); - Log.d(TAG, "signOut(): " + (successful ? "success" : "failed")); - - onDisconnected(); - }); + onDisconnected(); + }); + } catch (Exception ignored) {} } @Override @@ -633,7 +634,7 @@ private void onDisconnected() { public void onSignInButtonClicked() { try { startSignInIntent(); } catch (Exception ignored) {} } @Override - public void onSignOutButtonClicked() { signOut(); } + public void onSignOutButtonClicked() { try { signOut(); } catch (Exception ignored) {} } @Override public void onShowFriendsButtonClicked() { switchToFragment(mFriendsFragment); }