Fix ANR-like bug when resuming MainActivity.

This commit is contained in:
Cody Henthorne
2023-08-17 15:02:16 -04:00
committed by GitHub
parent 74d5faf3fa
commit 39c1c1e371
5 changed files with 101 additions and 17 deletions

View File

@@ -5,7 +5,6 @@
package org.thoughtcrime.securesms.components
import android.content.Context
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
@@ -27,7 +26,7 @@ class PromptBatterySaverDialogFragment : FixedRoundedCornerBottomSheetDialogFrag
companion object {
@JvmStatic
fun show(context: Context, fragmentManager: FragmentManager) {
fun show(fragmentManager: FragmentManager) {
if (fragmentManager.findFragmentByTag(BottomSheetUtil.STANDARD_BOTTOM_SHEET_FRAGMENT_TAG) == null) {
PromptBatterySaverDialogFragment().apply {
arguments = bundleOf()

View File

@@ -190,7 +190,7 @@ class NotificationsSettingsFragment : DSLSettingsFragment(R.string.preferences__
title = DSLSettingsText.from(R.string.preferences_notifications__troubleshoot),
isEnabled = true,
onClick = {
PromptBatterySaverDialogFragment.show(requireContext(), childFragmentManager)
PromptBatterySaverDialogFragment.show(childFragmentManager)
}
)
}