From b497156302a73fd2b14de16106dc218c30ec1702 Mon Sep 17 00:00:00 2001 From: David Perez Date: Wed, 27 Aug 2025 15:15:00 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=92=20PM-25143:=20Retain=20intent=20da?= =?UTF-8?q?ta=20on=20recreate=20(#5798)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/x8bit/bitwarden/MainActivity.kt | 32 +------------------ 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/app/src/main/kotlin/com/x8bit/bitwarden/MainActivity.kt b/app/src/main/kotlin/com/x8bit/bitwarden/MainActivity.kt index 2d2ae7d38e..81292d3c51 100644 --- a/app/src/main/kotlin/com/x8bit/bitwarden/MainActivity.kt +++ b/app/src/main/kotlin/com/x8bit/bitwarden/MainActivity.kt @@ -43,8 +43,6 @@ import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.flow.map import javax.inject.Inject -private const val ANDROID_15_BUG_MAX_REVISION: Int = 241007 - /** * Primary entry point for the application. */ @@ -217,35 +215,7 @@ class MainActivity : AppCompatActivity() { } private fun handleRecreate() { - val isOldAndroidBuildRevision = { - // This fetches the date portion of the ID in order to determine the revision of - // Android 15 being used and whether we want to use the `recreate` API or not. - // If we fail to parse a date, we assume it is not an old revision. - "\\.([^.]+)\\." - .toRegex() - .find(Build.ID) - ?.groups - ?.get(1) - ?.value - ?.toIntOrNull() - ?.let { it <= ANDROID_15_BUG_MAX_REVISION } == true - } - if (Build.VERSION.SDK_INT == Build.VERSION_CODES.VANILLA_ICE_CREAM && - isOldAndroidBuildRevision() - ) { - // This is done to avoid a bug in specific older revisions of Android 15. The bug has - // been fixed but certain phones that are no longer supported will never get the fix. - // The OS bug is tracked here: https://issuetracker.google.com/issues/370180732 - startActivity( - Intent - .makeMainActivity(componentName) - .addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION), - ) - finish() - overrideActivityTransition(OVERRIDE_TRANSITION_CLOSE, 0, 0) - } else { - ActivityCompat.recreate(this) - } + ActivityCompat.recreate(this) } private fun updateScreenCapture(isScreenCaptureAllowed: Boolean) {