From 8192f53f089f31a06a5c21e8adda288b847cc734 Mon Sep 17 00:00:00 2001 From: Sammy Khamis Date: Fri, 28 May 2021 13:43:03 -1000 Subject: [PATCH] [fenix] changes required for uniffi-ing logins component= --- .../providers/MasterPasswordTipProvider.kt | 29 ++++--------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/components/tips/providers/MasterPasswordTipProvider.kt b/app/src/main/java/org/mozilla/fenix/components/tips/providers/MasterPasswordTipProvider.kt index 0c28b2c18..afbfe269d 100644 --- a/app/src/main/java/org/mozilla/fenix/components/tips/providers/MasterPasswordTipProvider.kt +++ b/app/src/main/java/org/mozilla/fenix/components/tips/providers/MasterPasswordTipProvider.kt @@ -20,11 +20,11 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.launch import kotlinx.coroutines.withContext -import mozilla.appservices.logins.IdCollisionException -import mozilla.appservices.logins.InvalidRecordException -import mozilla.appservices.logins.LoginsStorageException -import mozilla.appservices.logins.ServerPassword -import mozilla.components.concept.storage.Login +import mozilla.components.service.sync.logins.IdCollisionException +import mozilla.components.service.sync.logins.InvalidRecordException +import mozilla.components.service.sync.logins.LoginsStorageException +import mozilla.components.service.sync.logins.ServerPassword +import mozilla.components.service.sync.logins.toLogin import mozilla.components.support.migration.FennecLoginsMPImporter import mozilla.components.support.migration.FennecProfile import org.mozilla.fenix.R @@ -198,7 +198,7 @@ class MasterPasswordTipProvider( context.components.core.passwordsStorage.add(it) } catch (e: InvalidRecordException) { // This record was invalid and we couldn't save this login - Sentry.capture("Master Password migration add login error $e for reason ${e.reason}") + Sentry.capture("Master Password migration add login error $e for reason ${e.message}") } catch (e: IdCollisionException) { // Nonempty ID was provided Sentry.capture("Master Password migration add login error $e") @@ -258,23 +258,6 @@ class MasterPasswordTipProvider( } } - /** - * Converts an Application Services [ServerPassword] to an Android Components [Login] - */ - fun ServerPassword.toLogin() = Login( - origin = hostname, - formActionOrigin = formSubmitURL, - httpRealm = httpRealm, - username = username, - password = password, - timesUsed = timesUsed, - timeCreated = timeCreated, - timeLastUsed = timeLastUsed, - timePasswordChanged = timePasswordChanged, - usernameField = usernameField, - passwordField = passwordField - ) - companion object { private const val HALF_OPACITY = .5F }