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:
parent
1ec45f33a2
commit
b2c01e442f
@ -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)
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user