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

Commit b8771bd6 authored by Nihar Thakkar's avatar Nihar Thakkar Committed by Sumit Pundir
Browse files

Don't enable polling by default, enable/disable IDLE connection based on Mail...

Don't enable polling by default, enable/disable IDLE connection based on Mail sync setting from Account Manager
parent cf3e3ec3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -291,7 +291,7 @@ public class Account implements BaseAccount, StoreConfig {
    protected Account(Context context) {
        accountUuid = UUID.randomUUID().toString();
        localStorageProviderId = StorageManager.getInstance(context).getDefaultProviderId();
        automaticCheckIntervalMinutes = 5;
        automaticCheckIntervalMinutes = -1;
        idleRefreshMinutes = 24;
        pushPollOnConnect = true;
        displayCount = K9.DEFAULT_VISIBLE_LIMIT;
@@ -422,7 +422,7 @@ public class Account implements BaseAccount, StoreConfig {
        transportUri = Base64.decode(storage.getString(accountUuid + ".transportUri", null));
        description = storage.getString(accountUuid + ".description", null);
        alwaysBcc = storage.getString(accountUuid + ".alwaysBcc", alwaysBcc);
        automaticCheckIntervalMinutes = storage.getInt(accountUuid + ".automaticCheckIntervalMinutes", 5);
        automaticCheckIntervalMinutes = storage.getInt(accountUuid + ".automaticCheckIntervalMinutes", -1);
        idleRefreshMinutes = storage.getInt(accountUuid + ".idleRefreshMinutes", 24);
        pushPollOnConnect = storage.getBoolean(accountUuid + ".pushPollOnConnect", true);
        displayCount = storage.getInt(accountUuid + ".displayCount", K9.DEFAULT_VISIBLE_LIMIT);
+4 −4
Original line number Diff line number Diff line
@@ -601,10 +601,10 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
                        if (account.getEmail().equals(emailId)) {
                            if (ContentResolver.getSyncAutomatically(eeloAccount,
                                    MAIL_CONTENT_AUTHORITY)) {
                                account.setAutomaticCheckIntervalMinutes(5);
                                account.setFolderPushMode(Account.FolderMode.FIRST_CLASS);
                            }
                            else {
                                account.setAutomaticCheckIntervalMinutes(-1);
                                account.setFolderPushMode(Account.FolderMode.NONE);
                            }
                            break;
                        }
@@ -615,10 +615,10 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
                        if (account.getEmail().equals(emailId)) {
                            if (ContentResolver.getSyncAutomatically(googleAccount,
                                    MAIL_CONTENT_AUTHORITY)) {
                                account.setAutomaticCheckIntervalMinutes(5);
                                account.setFolderPushMode(Account.FolderMode.FIRST_CLASS);
                            }
                            else {
                                account.setAutomaticCheckIntervalMinutes(-1);
                                account.setFolderPushMode(Account.FolderMode.NONE);
                            }
                            break;
                        }
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ class AccountConfigImpl implements AccountConfig, Parcelable {

    private boolean notifyNewMail = true;
    private boolean showOngoing;
    private int automaticCheckIntervalMinutes = 5;
    private int automaticCheckIntervalMinutes = -1;
    private Account.FolderMode folderPushMode = FolderMode.FIRST_CLASS;

    private DeletePolicy deletePolicy = DeletePolicy.ON_DELETE;
+4 −4
Original line number Diff line number Diff line
@@ -3630,11 +3630,11 @@ public class MessagingController {
                    if (account.getEmail().equals(emailId)) {
                        if (ContentResolver.getSyncAutomatically(eeloAccount,
                                MAIL_CONTENT_AUTHORITY)) {
                            account.setAutomaticCheckIntervalMinutes(5);
                            account.setFolderPushMode(Account.FolderMode.FIRST_CLASS);
                            return true;
                        }
                        else {
                            account.setAutomaticCheckIntervalMinutes(-1);
                            account.setFolderPushMode(Account.FolderMode.NONE);
                            return false;
                        }
                    }
@@ -3645,11 +3645,11 @@ public class MessagingController {
                    if (account.getEmail().equals(emailId)) {
                        if (ContentResolver.getSyncAutomatically(googleAccount,
                                MAIL_CONTENT_AUTHORITY)) {
                            account.setAutomaticCheckIntervalMinutes(5);
                            account.setFolderPushMode(Account.FolderMode.FIRST_CLASS);
                            return true;
                        }
                        else {
                            account.setAutomaticCheckIntervalMinutes(-1);
                            account.setFolderPushMode(Account.FolderMode.NONE);
                            return false;
                        }
                    }
+3 −2
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
                android:layout_height="wrap_content"
                android:ellipsize="start"
		android:singleLine="true"
		android:textColor="@color/colorAccent"
                android:textSize="14sp" />

            <TextView