From 48e8026b342bafe3e4b4bfeaaa8b2b658bc1e6e9 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Mon, 18 Jun 2012 17:20:49 -0700 Subject: [PATCH] Remove exchange-specific layouts (merge into incoming) * Configure everything via services.xml, removing lots of duplicated layouts and code * Check that this works on phone and tablet * More to do: get rid of abstract class with only one subclass (AccountServerBaseFragment), remove as many references in Email2 to specific protocols (a lot has already been done) Change-Id: I071e0aba029e2ccb9631d13b2b6d41ab74b1341b --- .../emailcommon/provider/HostAuth.java | 14 +- .../account_setup_exchange.xml | 84 ---- .../account_setup_exchange.xml | 96 ---- .../account_setup_account_type.xml | 28 +- .../account_setup_exchange_fragment.xml | 134 ----- .../account_setup_incoming_fragment.xml | 20 + email2/res/layout-sw600dp/account_type.xml | 23 + .../account_settings_exchange_fragment.xml | 52 -- email2/res/layout/account_setup_exchange.xml | 43 -- .../account_setup_exchange_fragment.xml | 89 ---- .../account_setup_incoming_fragment.xml | 22 + email2/res/values/attrs.xml | 18 +- email2/res/xml/services.xml | 21 +- .../email/activity/setup/AccountSettings.java | 2 +- .../setup/AccountSettingsFragment.java | 12 +- .../setup/AccountSetupExchangeFragment.java | 457 ------------------ .../activity/setup/AccountSetupIncoming.java | 6 +- .../setup/AccountSetupIncomingFragment.java | 173 +++++-- .../activity/setup/AccountSetupOptions.java | 8 +- .../activity/setup/AccountSetupType.java | 28 +- .../email/service/EmailServiceUtils.java | 47 +- 21 files changed, 282 insertions(+), 1095 deletions(-) delete mode 100644 email2/res/layout-sw600dp-land/account_setup_exchange.xml delete mode 100644 email2/res/layout-sw600dp-port/account_setup_exchange.xml delete mode 100644 email2/res/layout-sw600dp/account_setup_exchange_fragment.xml create mode 100644 email2/res/layout-sw600dp/account_type.xml delete mode 100644 email2/res/layout/account_settings_exchange_fragment.xml delete mode 100644 email2/res/layout/account_setup_exchange.xml delete mode 100644 email2/res/layout/account_setup_exchange_fragment.xml delete mode 100644 email2/src/com/android/email/activity/setup/AccountSetupExchangeFragment.java diff --git a/email2/emailcommon/src/com/android/emailcommon/provider/HostAuth.java b/email2/emailcommon/src/com/android/emailcommon/provider/HostAuth.java index 8729418bc..c41453be2 100644 --- a/email2/emailcommon/src/com/android/emailcommon/provider/HostAuth.java +++ b/email2/emailcommon/src/com/android/emailcommon/provider/HostAuth.java @@ -269,19 +269,7 @@ public final class HostAuth extends EmailContent implements HostAuthColumns, Par mPort = port; if (mPort == PORT_UNKNOWN) { boolean useSSL = ((mFlags & FLAG_SSL) != 0); - // infer port# from protocol + security - // SSL implies a different port - TLS runs in the "regular" port - // NOTE: Although the port should be setup in the various setup screens, this - // block cannot easily be moved because we get process URIs from other sources - // (e.g. for tests, provider templates and account restore) that may or may not - // have a port specified. - if (SCHEME_POP3.equals(mProtocol)) { - mPort = useSSL ? 995 : 110; - } else if (SCHEME_IMAP.equals(mProtocol)) { - mPort = useSSL ? 993 : 143; - } else if (SCHEME_EAS.equals(mProtocol)) { - mPort = useSSL ? 443 : 80; - } else if (SCHEME_SMTP.equals(mProtocol)) { + if (SCHEME_SMTP.equals(mProtocol)) { mPort = useSSL ? 465 : 587; } } diff --git a/email2/res/layout-sw600dp-land/account_setup_exchange.xml b/email2/res/layout-sw600dp-land/account_setup_exchange.xml deleted file mode 100644 index 812e9bc60..000000000 --- a/email2/res/layout-sw600dp-land/account_setup_exchange.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - -