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

Commit a3e30186 authored by Michael Enoma's avatar Michael Enoma 👽
Browse files

Google Account Fix beta

parent 3efbcbb2
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,6 +2,6 @@
<resources>

    <style name="ToolbarTheme" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
       <item name="colorControlNormal">@lineageos.platform:color/color_default_accent</item>
    <!-- */   <item name="colorControlNormal">@lineageos.platform:color/color_default_accent</item>-->
    </style>
</resources>
 No newline at end of file
+13 −3
Original line number Diff line number Diff line
@@ -76,6 +76,9 @@ import org.koin.androidx.viewmodel.ext.android.viewModel
import org.koin.core.component.KoinComponent
import org.koin.core.component.inject
import timber.log.Timber
import org.koin.android.ext.android.inject
import org.koin.androidx.viewmodel.ext.android.viewModel
import org.koin.core.component.inject

/**
 * MessageList is the primary user interface for the program. This Activity shows a list of messages.
@@ -161,6 +164,8 @@ open class MessageList :
            accounts = preferences.accounts
        }


        deleteIncompleteAccounts(accounts)
        val hasAccountSetup = accounts.any { it.isFinishedSetup }
        if (!hasAccountSetup) {
            AccountSetupBasics.actionNewAccount(this)
@@ -1617,9 +1622,8 @@ open class MessageList :

    private fun addNewAccountsAutomatically(accounts: List<Account>): Boolean {
        return try {
            val am: AccountManager = AccountManager.get(this) // "this" references the current Context
            val eeloAccounts: Array<android.accounts.Account> = getEeloAccountsOnDevice()
            val googleAccounts: Array<out android.accounts.Account> = getGoogleAccountsOnDevice()
            val googleAccounts: Array<android.accounts.Account> = getGoogleAccountsOnDevice()
            var accountWasAdded = false
            for (eeloAccount in eeloAccounts) {
                val emailId: String = accountManager.getUserData(eeloAccount, ACCOUNT_EMAIL_ADDRESS_KEY)
@@ -1637,6 +1641,7 @@ open class MessageList :
                    accountWasAdded = true
                }
            }

            for (googleAccount in googleAccounts) {
                val emailId: String = accountManager.getUserData(googleAccount, ACCOUNT_EMAIL_ADDRESS_KEY)
                var accountIsSignedIn = false
@@ -1652,10 +1657,14 @@ open class MessageList :
                }
                if (!accountIsSignedIn) {
//                    GoogleAccountCreator.createAccount(this, emailId)
//                    accountWasAdded = true
//                }
//            }
                    EeloAccountCreator.createAccount(this, emailId, "")
                    accountWasAdded = true
                }
            }

            accountWasAdded
        } catch (e: SecurityException) {
            e.printStackTrace()
@@ -1789,3 +1798,4 @@ open class MessageList :
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ package com.fsck.k9.activity.setup.accountmanager

object AccountManagerConstants {
    const val EELO_ACCOUNT_TYPE = "e.foundation.webdav.eelo"
    const val GOOGLE_ACCOUNT_TYPE = "webdav.google"
    const val GOOGLE_ACCOUNT_TYPE = "foundation.e.accountmanager.google"
    const val ACCOUNT_EMAIL_ADDRESS_KEY = "email_address"
    const val MAIL_CONTENT_AUTHORITY = "foundation.e.mail.provider.AppContentProvider"
}
+2 −1
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@ import com.fsck.k9.autodiscovery.api.DiscoveryResults;
import com.fsck.k9.autodiscovery.api.DiscoveryTarget;
import com.fsck.k9.autodiscovery.providersxml.ProvidersXmlDiscovery;
import com.fsck.k9.mail.ServerSettings;
import com.fsck.k9.mailstore.SpecialLocalFoldersCreator;
import com.fsck.k9.ui.ConnectionSettings;
import com.fsck.k9.mailstore.SpecialLocalFoldersCreator;
import timber.log.Timber;


@@ -53,6 +53,7 @@ public class EeloAccountCreator {
    }



    private static ConnectionSettings providersXmlDiscoveryDiscover(String email) {
        DiscoveryResults discoveryResults =
                providersXmlDiscovery.discover(email, DiscoveryTarget.INCOMING_AND_OUTGOING);