From ef03f5f8a2bdcb354d18378da90b4f6f13f35650 Mon Sep 17 00:00:00 2001 From: davinci9196 Date: Sat, 12 Oct 2024 11:13:19 +0800 Subject: [PATCH] Fixed the issue that multiple LoginActivity pages exist in the background record when logging in via GoogleBook --- play-services-core/src/main/AndroidManifest.xml | 1 + .../main/java/org/microg/gms/auth/login/LoginActivity.java | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/play-services-core/src/main/AndroidManifest.xml b/play-services-core/src/main/AndroidManifest.xml index 2e6c2a634a..9161187bac 100644 --- a/play-services-core/src/main/AndroidManifest.xml +++ b/play-services-core/src/main/AndroidManifest.xml @@ -413,6 +413,7 @@ android:configChanges="keyboardHidden|keyboard|orientation|screenSize" android:exported="true" android:process=":ui" + android:launchMode="singleTop" android:theme="@style/Theme.LoginBlue"> 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 dd9a1be6ac..831c4751f4 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 @@ -186,11 +186,12 @@ protected void onBackButtonClicked() { } public void loginCanceled() { + Log.d(TAG, "loginCanceled: "); setResult(RESULT_CANCELED); if (response != null) { response.onError(AccountManager.ERROR_CODE_CANCELED, "Canceled"); } - finish(); + if (SDK_INT >= LOLLIPOP) { finishAndRemoveTask(); } else finish(); } @Override @@ -383,7 +384,7 @@ public void onResponse(AuthResponse response) { } checkin(true); returnSuccessResponse(account); - finish(); + if (SDK_INT >= LOLLIPOP) { finishAndRemoveTask(); } else finish(); } @Override @@ -669,7 +670,7 @@ public final void showView() { @JavascriptInterface public final void skipLogin() { Log.d(TAG, "JSBridge: skipLogin"); - finish(); + loginCanceled(); } @JavascriptInterface