2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/13959: rename to attachListenerToDisablePenaltyDeath for clarity.

This commit is contained in:
Michael Comella 2020-09-22 14:56:25 -07:00 committed by Michael Comella
parent 1ec45f33a2
commit b2c01e442f
3 changed files with 4 additions and 4 deletions

View File

@ -150,7 +150,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity {
private lateinit var navigationToolbar: Toolbar
final override fun onCreate(savedInstanceState: Bundle?) {
StrictModeManager.changeStrictModePolicies(supportFragmentManager)
StrictModeManager.attachListenerToDisablePenaltyDeath(supportFragmentManager)
// There is disk read violations on some devices such as samsung and pixel for android 9/10
StrictMode.allowThreadDiskReads().resetPoliciesAfter {
super.onCreate(savedInstanceState)

View File

@ -46,11 +46,11 @@ object StrictModeManager {
}
/**
* Revert strict mode to disable penalty. Tied to fragment lifecycle since strict mode
* Revert strict mode to disable penalty based on fragment lifecycle since strict mode
* needs to switch to penalty logs. Using the fragment life cycle allows decoupling from any
* specific fragment.
*/
fun changeStrictModePolicies(fragmentManager: FragmentManager) {
fun attachListenerToDisablePenaltyDeath(fragmentManager: FragmentManager) {
fragmentManager.registerFragmentLifecycleCallbacks(object :
FragmentManager.FragmentLifecycleCallbacks() {
override fun onFragmentResumed(fm: FragmentManager, f: Fragment) {

View File

@ -63,7 +63,7 @@ class StrictModeManagerTest {
fun `test changeStrictModePolicies`() {
val callbacks = slot<FragmentManager.FragmentLifecycleCallbacks>()
StrictModeManager.changeStrictModePolicies(fragmentManager)
StrictModeManager.attachListenerToDisablePenaltyDeath(fragmentManager)
verify { fragmentManager.registerFragmentLifecycleCallbacks(capture(callbacks), false) }
confirmVerified(fragmentManager)