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

Commit 1faa750b authored by Michael Enoma's avatar Michael Enoma
Browse files

Try auto add google accounts

parent f0a77702
Loading
Loading
Loading
Loading
+23 −0
Original line number Original line Diff line number Diff line
@@ -1643,6 +1643,29 @@ open class MessageList :
//                    accountWasAdded = true
//                    accountWasAdded = true
//                }
//                }
//            }
//            }
            for (googleAccount in googleAccounts) {
                val emailId: String = accountManager.getUserData(googleAccount, ACCOUNT_EMAIL_ADDRESS_KEY)
                var accountIsSignedIn = false
                for (account in accounts) {
                    if (emailId == account.email) {
                        if (account.name == null) { // we need to fix an old bug
                            account.name = emailId
                            Preferences.getPreferences(this).saveAccount(account)
                        }
                        accountIsSignedIn = true
                        break
                    }
                }
                if (!accountIsSignedIn) {
//                    GoogleAccountCreator.createAccount(this, emailId)
//                    accountWasAdded = true
//                }
//            }
                    EeloAccountCreator.createAccount(this, emailId, "")
                    accountWasAdded = true
                }
            }

            accountWasAdded
            accountWasAdded
        } catch (e: SecurityException) {
        } catch (e: SecurityException) {
            e.printStackTrace()
            e.printStackTrace()