mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-17 15:26:23 +00:00
Bug 1851678 - Catch AutofillApiException exception when fetching autofill data and setting startup metrics
This commit is contained in:
parent
200dab4054
commit
3db5fbce22
@ -28,6 +28,7 @@ import kotlinx.coroutines.GlobalScope
|
|||||||
import kotlinx.coroutines.async
|
import kotlinx.coroutines.async
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import mozilla.appservices.Megazord
|
import mozilla.appservices.Megazord
|
||||||
|
import mozilla.appservices.autofill.AutofillApiException
|
||||||
import mozilla.components.browser.state.action.SystemAction
|
import mozilla.components.browser.state.action.SystemAction
|
||||||
import mozilla.components.browser.state.selector.selectedTab
|
import mozilla.components.browser.state.selector.selectedTab
|
||||||
import mozilla.components.browser.state.state.searchEngines
|
import mozilla.components.browser.state.state.searchEngines
|
||||||
@ -837,9 +838,13 @@ open class FenixApplication : LocaleAwareApplication(), Provider {
|
|||||||
|
|
||||||
@OptIn(DelicateCoroutinesApi::class)
|
@OptIn(DelicateCoroutinesApi::class)
|
||||||
GlobalScope.launch(IO) {
|
GlobalScope.launch(IO) {
|
||||||
val autoFillStorage = applicationContext.components.core.autofillStorage
|
try {
|
||||||
Addresses.savedAll.set(autoFillStorage.getAllAddresses().size.toLong())
|
val autoFillStorage = applicationContext.components.core.autofillStorage
|
||||||
CreditCards.savedAll.set(autoFillStorage.getAllCreditCards().size.toLong())
|
Addresses.savedAll.set(autoFillStorage.getAllAddresses().size.toLong())
|
||||||
|
CreditCards.savedAll.set(autoFillStorage.getAllCreditCards().size.toLong())
|
||||||
|
} catch (e: AutofillApiException) {
|
||||||
|
logger.error("Failed to fetch autofill data", e)
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val passwordsStorage = applicationContext.components.core.passwordsStorage
|
val passwordsStorage = applicationContext.components.core.passwordsStorage
|
||||||
|
Loading…
Reference in New Issue
Block a user