Loading mobile/android/fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistFragment.kt +13 −0 Original line number Diff line number Diff line Loading @@ -212,6 +212,7 @@ class TorConnectionAssistFragment : Fragment(), UserInteractionHandler, SystemIn if (screen.regionDropDownVisible) { if (binding.countryDropDown.isEmpty()) { regionDropDownSpinnerAdapter = initializeSpinner() torConnectionAssistViewModel.fetchFrequentRegions() torConnectionAssistViewModel.fetchRegionNames() } Loading Loading @@ -285,6 +286,18 @@ class TorConnectionAssistFragment : Fragment(), UserInteractionHandler, SystemIn } } viewLifecycleOwner.lifecycleScope.launch { repeatOnLifecycle(Lifecycle.State.STARTED) { torConnectionAssistViewModel.frequentRegionCodes.collect { if (it != null) { for (region in it) { Log.d(TAG, "collected region: $region") } } } } } return spinnerAdapter } Loading mobile/android/fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistViewModel.kt +12 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,14 @@ class TorConnectionAssistViewModel( } } fun fetchFrequentRegions() { torAndroidIntegration.frequentRegionNamesGet { frequentRegionNames -> if (frequentRegionNames != null) { frequentRegionCodes.value = frequentRegionNames } } } override fun onCleared() { torAndroidIntegration.unregisterBootstrapStateChangeListener(this) super.onCleared() Loading @@ -96,6 +104,10 @@ class TorConnectionAssistViewModel( MutableStateFlow(null) } val frequentRegionCodes: MutableStateFlow<Array<String>?> by lazy { MutableStateFlow(null) } val selectedCountryCode: MutableStateFlow<String> by lazy { MutableStateFlow("automatic") } Loading Loading
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistFragment.kt +13 −0 Original line number Diff line number Diff line Loading @@ -212,6 +212,7 @@ class TorConnectionAssistFragment : Fragment(), UserInteractionHandler, SystemIn if (screen.regionDropDownVisible) { if (binding.countryDropDown.isEmpty()) { regionDropDownSpinnerAdapter = initializeSpinner() torConnectionAssistViewModel.fetchFrequentRegions() torConnectionAssistViewModel.fetchRegionNames() } Loading Loading @@ -285,6 +286,18 @@ class TorConnectionAssistFragment : Fragment(), UserInteractionHandler, SystemIn } } viewLifecycleOwner.lifecycleScope.launch { repeatOnLifecycle(Lifecycle.State.STARTED) { torConnectionAssistViewModel.frequentRegionCodes.collect { if (it != null) { for (region in it) { Log.d(TAG, "collected region: $region") } } } } } return spinnerAdapter } Loading
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/tor/TorConnectionAssistViewModel.kt +12 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,14 @@ class TorConnectionAssistViewModel( } } fun fetchFrequentRegions() { torAndroidIntegration.frequentRegionNamesGet { frequentRegionNames -> if (frequentRegionNames != null) { frequentRegionCodes.value = frequentRegionNames } } } override fun onCleared() { torAndroidIntegration.unregisterBootstrapStateChangeListener(this) super.onCleared() Loading @@ -96,6 +104,10 @@ class TorConnectionAssistViewModel( MutableStateFlow(null) } val frequentRegionCodes: MutableStateFlow<Array<String>?> by lazy { MutableStateFlow(null) } val selectedCountryCode: MutableStateFlow<String> by lazy { MutableStateFlow("automatic") } Loading