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

Commit cf5ef30c authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

Add abstraction on openPgpProvider method on `AccountSetupBasics` class

issue: https://gitlab.e.foundation/e/backlog/-/issues/5445

`mAccount.setOpenPgpProvider(OpenPgpProviderUtil.getOpenPgpProviderPackage(getApplicationContext()));` is replicated in 2 different places.
It should be called from single place.
parent 688afe2b
Loading
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ public class AccountSetupBasics extends K9Activity
        if (mAccount == null) {
            mAccount = Preferences.getPreferences(this).newAccount();
            mAccount.setChipColor(accountCreator.pickColor());
            mAccount.setOpenPgpProvider(OpenPgpProviderUtil.getOpenPgpProviderPackage(getApplicationContext()));
            setOpenPgpProvider();
        }

        mAccount.setSenderName(getOwnerName());
@@ -392,7 +392,7 @@ public class AccountSetupBasics extends K9Activity
        if (mAccount == null) {
            mAccount = Preferences.getPreferences(this).newAccount();
            mAccount.setChipColor(accountCreator.pickColor());
            mAccount.setOpenPgpProvider(OpenPgpProviderUtil.getOpenPgpProviderPackage(getApplicationContext()));
            setOpenPgpProvider();
        }
        mAccount.setSenderName(getOwnerName());
        mAccount.setEmail(email);
@@ -403,6 +403,10 @@ public class AccountSetupBasics extends K9Activity
        AccountSetupAccountType.actionSelectAccountType(this, mAccount, false, initialAccountSettings);
    }

    private void setOpenPgpProvider() {
        mAccount.setOpenPgpProvider(OpenPgpProviderUtil.getOpenPgpProviderPackage(getApplicationContext()));
    }

    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.next) {