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

Commit 4c27a970 authored by Nihar Thakkar's avatar Nihar Thakkar
Browse files

Modify authors, add ResetService intent for /e/ drive

parent 6954b813
Loading
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -13,16 +13,15 @@ import android.content.Context
import android.content.Intent
import android.database.DatabaseUtils
import android.os.Bundle
import at.bitfire.davdroid.AccountSettings
import at.bitfire.davdroid.R
import at.bitfire.davdroid.log.Logger
import at.bitfire.davdroid.model.ServiceDB
import at.bitfire.davdroid.resource.LocalAddressBook
import at.bitfire.davdroid.ui.setup.LoginActivity
import net.openid.appauth.AuthState
import net.openid.appauth.AuthorizationService
import java.util.*
import java.util.logging.Level
import kotlin.collections.ArrayList
import kotlin.collections.HashSet


/**
@@ -100,6 +99,18 @@ class EeloAccountAuthenticatorService : Service(), OnAccountsUpdateListener {

    override fun onAccountsUpdated(accounts: Array<out Account>?) {
        cleanupAccounts(this)

        val eeloAccounts = ArrayList<Account>(accounts?.asList())
        eeloAccounts.removeIf { it.type != getString(R.string.eelo_account_type) }
        eeloAccounts.removeAll(accountManager.getAccountsByType(getString(
                R.string.eelo_account_type)))
        for (removedAccount in eeloAccounts) {
            val intent = Intent("drive.services.ResetService")
            intent.setPackage("io.eelo.drive")
            intent.putExtra(AccountManager.KEY_ACCOUNT_NAME, removedAccount.name)
            intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, removedAccount.type)
            startService(intent)
        }
    }


+2 −2
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ class AccountDetailsFragment : Fragment(), LoaderManager.LoaderCallbacks<CreateS
                                        .KEY_ACCOUNT_AUTHENTICATOR_RESPONSE).onResult(null)
                    }
                    if (activity!!.intent.getStringExtra(LoginActivity.SETUP_ACCOUNT_PROVIDER_TYPE) == LoginActivity.ACCOUNT_PROVIDER_EELO) {
                        val intent = Intent("drive.services.initializerService")
                        val intent = Intent("drive.services.InitializerService")
                        intent.setPackage("io.eelo.drive")
                        intent.putExtra(AccountManager.KEY_ACCOUNT_NAME, view!!.account_name.text.toString())
                        intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, getString(R.string.eelo_account_type))
@@ -154,7 +154,7 @@ class AccountDetailsFragment : Fragment(), LoaderManager.LoaderCallbacks<CreateS
                                        .KEY_ACCOUNT_AUTHENTICATOR_RESPONSE).onResult(null)
                    }
                    if (activity!!.intent.getStringExtra(LoginActivity.SETUP_ACCOUNT_PROVIDER_TYPE) == LoginActivity.ACCOUNT_PROVIDER_EELO) {
                        val intent = Intent("drive.services.initializerService")
                        val intent = Intent("drive.services.InitializerService")
                        intent.setPackage("io.eelo.drive")
                        intent.putExtra(AccountManager.KEY_ACCOUNT_NAME, view!!.account_name.text.toString())
                        intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, getString(R.string.eelo_account_type))
Compare 1796f4ce to b6096a32
Original line number Diff line number Diff line
Subproject commit 1796f4ced995c624d889e7fe3aadd3694c1fb85a
Subproject commit b6096a32fcb9a23a9593d8634f84a9a7f38f5c5f