Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43a3bd30 authored by Michael Enoma's avatar Michael Enoma 👽
Browse files

Google account name and password

parent be7ee18f
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -39,6 +39,7 @@ import com.fsck.k9.Preferences
import com.fsck.k9.account.BackgroundAccountRemover
import com.fsck.k9.account.BackgroundAccountRemover
import com.fsck.k9.activity.compose.MessageActions
import com.fsck.k9.activity.compose.MessageActions
import com.fsck.k9.activity.setup.AccountSetupBasics
import com.fsck.k9.activity.setup.AccountSetupBasics
import com.fsck.k9.activity.setup.accountmanager.AccountManagerConstants.KEY_ACCOUNT_NAME
import com.fsck.k9.controller.MessageReference
import com.fsck.k9.controller.MessageReference
import com.fsck.k9.fragment.MessageListFragment
import com.fsck.k9.fragment.MessageListFragment
import com.fsck.k9.fragment.MessageListFragment.MessageListFragmentListener
import com.fsck.k9.fragment.MessageListFragment.MessageListFragmentListener
@@ -1638,10 +1639,11 @@ open class MessageList :
            }
            }
            for (googleAccount in googleAccounts) {
            for (googleAccount in googleAccounts) {
                val emailId: String = accountManager.getUserData(googleAccount, ACCOUNT_EMAIL_ADDRESS_KEY)
                val emailId: String = accountManager.getUserData(googleAccount, ACCOUNT_EMAIL_ADDRESS_KEY)
                val accountName: String = accountManager.getUserData(googleAccount, KEY_ACCOUNT_NAME)
                var accountIsSignedIn = false
                var accountIsSignedIn = false
                for (account in accounts) {
                for (account in accounts) {
                    if (emailId == account.email) {
                    if (emailId == account.email) {
                        if (account.name == null) { // we need to fix an old bug
                        if (account.name == accountName) {
                            account.name = emailId
                            account.name = emailId
                            Preferences.getPreferences(this).saveAccount(account)
                            Preferences.getPreferences(this).saveAccount(account)
                        }
                        }
@@ -1650,6 +1652,7 @@ open class MessageList :
                    }
                    }
                }
                }
                if (!accountIsSignedIn) {
                if (!accountIsSignedIn) {
                    val password: String = accountManager.getPassword(googleAccount)
//                    GoogleAccountCreator.createAccount(this, emailId)
//                    GoogleAccountCreator.createAccount(this, emailId)
                    EeloAccountCreator.createAccount(this, emailId, "")
                    EeloAccountCreator.createAccount(this, emailId, "")
                    accountWasAdded = true
                    accountWasAdded = true
+1 −0
Original line number Original line Diff line number Diff line
@@ -4,5 +4,6 @@ object AccountManagerConstants {
    const val EELO_ACCOUNT_TYPE = "e.foundation.webdav.eelo"
    const val EELO_ACCOUNT_TYPE = "e.foundation.webdav.eelo"
    const val GOOGLE_ACCOUNT_TYPE = "e.foundation.webdav.google"
    const val GOOGLE_ACCOUNT_TYPE = "e.foundation.webdav.google"
    const val ACCOUNT_EMAIL_ADDRESS_KEY = "email_address"
    const val ACCOUNT_EMAIL_ADDRESS_KEY = "email_address"
    const val KEY_ACCOUNT_NAME = "account_name"
    const val MAIL_CONTENT_AUTHORITY = "foundation.e.mail.provider.AppContentProvider"
    const val MAIL_CONTENT_AUTHORITY = "foundation.e.mail.provider.AppContentProvider"
}
}