Handle internal push states when showing sync interval

* We turn them into "push", which is the external representation
  of those states (ping and push/hold)

Bug: 5327559
Change-Id: I843f37e4619f1c33cdafbf8a3a6a39abb8e8834c
This commit is contained in:
Marc Blank 2011-09-15 14:11:11 -07:00
parent 7683a43117
commit a49da87191

View File

@ -222,15 +222,23 @@ public class MailboxSettings extends PreferenceActivity {
* @return current sync interval setting from the objects
*/
private int getSyncInterval() {
int syncInterval;
if (mMailbox.mType == Mailbox.TYPE_INBOX) {
return mAccount.mSyncInterval;
syncInterval = mAccount.mSyncInterval;
} else {
if (mMailbox.mSyncInterval == 0) {
// 0 is the default value, and it means "don't sync" (for non-inbox mailboxes)
return Mailbox.CHECK_INTERVAL_NEVER;
syncInterval = Mailbox.CHECK_INTERVAL_NEVER;
} else {
syncInterval = mMailbox.mSyncInterval;
}
return mMailbox.mSyncInterval;
}
// In the case of the internal push states, use "push"
if (syncInterval == Mailbox.CHECK_INTERVAL_PING ||
syncInterval == Mailbox.CHECK_INTERVAL_PUSH_HOLD) {
syncInterval = Mailbox.CHECK_INTERVAL_PUSH;
}
return syncInterval;
}
/**