In theory, the service in question isn't used on the no-exchange-support build,
+ * because we won't have any exchange accounts in that case, so we wouldn't have to have this
+ * class. However, there are a few places we do use the service even if there's no exchange
+ * accounts (e.g. setLogging), so this class is added for safety and simplicity.
+ */
+ private static class NullEmailService implements IEmailService {
+ public static final NullEmailService INSTANCE = new NullEmailService();
+
+ public Bundle autoDiscover(String userName, String password) throws RemoteException {
+ return Bundle.EMPTY;
+ }
+
+ public boolean createFolder(long accountId, String name) throws RemoteException {
+ return false;
+ }
+
+ public boolean deleteFolder(long accountId, String name) throws RemoteException {
+ return false;
+ }
+
+ public void hostChanged(long accountId) throws RemoteException {
+ }
+
+ public void loadAttachment(long attachmentId, String destinationFile,
+ String contentUriString) throws RemoteException {
+ }
+
+ public void loadMore(long messageId) throws RemoteException {
+ }
+
+ public boolean renameFolder(long accountId, String oldName, String newName)
+ throws RemoteException {
+ return false;
+ }
+
+ public void sendMeetingResponse(long messageId, int response) throws RemoteException {
+ }
+
+ public void setCallback(IEmailServiceCallback cb) throws RemoteException {
+ }
+
+ public void setLogging(int on) throws RemoteException {
+ }
+
+ public void startSync(long mailboxId) throws RemoteException {
+ }
+
+ public void stopSync(long mailboxId) throws RemoteException {
+ }
+
+ public void updateFolderList(long accountId) throws RemoteException {
+ }
+
+ public int validate(String protocol, String host, String userName, String password,
+ int port, boolean ssl, boolean trustCertificates) throws RemoteException {
+ return MessagingException.UNSPECIFIED_EXCEPTION;
+ }
+
+ public IBinder asBinder() {
+ return null;
+ }
}
}
diff --git a/src/com/android/email/activity/Debug.java b/src/com/android/email/activity/Debug.java
index 4526f0d0a..eb42a95eb 100644
--- a/src/com/android/email/activity/Debug.java
+++ b/src/com/android/email/activity/Debug.java
@@ -53,21 +53,24 @@ public class Debug extends Activity implements OnCheckedChangeListener {
mVersionView = (TextView)findViewById(R.id.version);
mEnableDebugLoggingView = (CheckBox)findViewById(R.id.debug_logging);
mEnableSensitiveLoggingView = (CheckBox)findViewById(R.id.sensitive_logging);
- mEnableExchangeLoggingView = (CheckBox)findViewById(R.id.exchange_logging);
- mEnableExchangeFileLoggingView = (CheckBox)findViewById(R.id.exchange_file_logging);
mEnableDebugLoggingView.setOnCheckedChangeListener(this);
mEnableSensitiveLoggingView.setOnCheckedChangeListener(this);
- mEnableExchangeLoggingView.setOnCheckedChangeListener(this);
- mEnableExchangeFileLoggingView.setOnCheckedChangeListener(this);
mVersionView.setText(String.format(getString(R.string.debug_version_fmt).toString(),
getString(R.string.build_number)));
mEnableDebugLoggingView.setChecked(Email.DEBUG);
mEnableSensitiveLoggingView.setChecked(Email.DEBUG_SENSITIVE);
+
+ //EXCHANGE-REMOVE-SECTION-START
+ mEnableExchangeLoggingView = (CheckBox)findViewById(R.id.exchange_logging);
+ mEnableExchangeFileLoggingView = (CheckBox)findViewById(R.id.exchange_file_logging);
+ mEnableExchangeLoggingView.setOnCheckedChangeListener(this);
+ mEnableExchangeFileLoggingView.setOnCheckedChangeListener(this);
mEnableExchangeLoggingView.setChecked(Eas.USER_LOG);
mEnableExchangeFileLoggingView.setChecked(Eas.FILE_LOG);
+ //EXCHANGE-REMOVE-SECTION-END
}
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@@ -80,6 +83,7 @@ public class Debug extends Activity implements OnCheckedChangeListener {
Email.DEBUG_SENSITIVE = isChecked;
mPreferences.setEnableSensitiveLogging(Email.DEBUG_SENSITIVE);
break;
+ //EXCHANGE-REMOVE-SECTION-START
case R.id.exchange_logging:
mPreferences.setEnableExchangeLogging(isChecked);
break;
@@ -89,6 +93,7 @@ public class Debug extends Activity implements OnCheckedChangeListener {
FileLogger.close();
}
break;
+ //EXCHANGE-REMOVE-SECTION-END
}
updateLoggingFlags(this);
@@ -115,11 +120,13 @@ public class Debug extends Activity implements OnCheckedChangeListener {
* Load enabled debug flags from the preferences and upadte the EAS debug flag.
*/
public static void updateLoggingFlags(Context context) {
+ //EXCHANGE-REMOVE-SECTION-START
Preferences prefs = Preferences.getPreferences(context);
int debugLogging = prefs.getEnableDebugLogging() ? Eas.DEBUG_BIT : 0;
int exchangeLogging = prefs.getEnableExchangeLogging() ? Eas.DEBUG_EXCHANGE_BIT : 0;
int fileLogging = prefs.getEnableExchangeFileLogging() ? Eas.DEBUG_FILE_BIT : 0;
int debugBits = debugLogging | exchangeLogging | fileLogging;
Controller.getInstance(context).serviceLogging(debugBits);
+ //EXCHANGE-REMOVE-SECTION-END
}
}
diff --git a/src/com/android/email/activity/setup/AccountSettings.java b/src/com/android/email/activity/setup/AccountSettings.java
index f44bba464..384586255 100644
--- a/src/com/android/email/activity/setup/AccountSettings.java
+++ b/src/com/android/email/activity/setup/AccountSettings.java
@@ -24,7 +24,6 @@ import com.android.email.mail.Store;
import com.android.email.provider.EmailContent.Account;
import com.android.email.provider.EmailContent.AccountColumns;
import com.android.email.provider.EmailContent.HostAuth;
-import com.android.exchange.Eas;
import android.app.Activity;
import android.content.ContentResolver;
diff --git a/src/com/android/email/activity/setup/AccountSetupAccountType.java b/src/com/android/email/activity/setup/AccountSetupAccountType.java
index 03b8ae947..a4f5075c8 100644
--- a/src/com/android/email/activity/setup/AccountSetupAccountType.java
+++ b/src/com/android/email/activity/setup/AccountSetupAccountType.java
@@ -157,14 +157,16 @@ public class AccountSetupAccountType extends Activity implements OnClickListener
* like this.
*/
private boolean isExchangeAvailable() {
+ //EXCHANGE-REMOVE-SECTION-START
try {
URI uri = new URI(mAccount.getStoreUri(this));
uri = new URI("eas", uri.getUserInfo(), uri.getHost(), uri.getPort(), null, null, null);
Store.StoreInfo storeInfo = Store.StoreInfo.getStoreInfo(uri.toString(), this);
return (storeInfo != null && checkAccountInstanceLimit(storeInfo));
} catch (URISyntaxException e) {
- return false;
}
+ //EXCHANGE-REMOVE-SECTION-END
+ return false;
}
/**
diff --git a/src/com/android/email/mail/store/ExchangeStore.java b/src/com/android/email/mail/store/ExchangeStore.java
index 0f01e3192..9935d50ea 100644
--- a/src/com/android/email/mail/store/ExchangeStore.java
+++ b/src/com/android/email/mail/store/ExchangeStore.java
@@ -25,7 +25,6 @@ import com.android.email.mail.Store;
import com.android.email.mail.StoreSynchronizer;
import com.android.email.provider.EmailContent.Account;
import com.android.email.service.EasAuthenticatorService;
-import com.android.exchange.Eas;
import android.accounts.AccountManager;
import android.accounts.AccountManagerCallback;
diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java
index e01b9487d..984d48149 100644
--- a/src/com/android/email/provider/EmailProvider.java
+++ b/src/com/android/email/provider/EmailProvider.java
@@ -30,7 +30,6 @@ import com.android.email.provider.EmailContent.MailboxColumns;
import com.android.email.provider.EmailContent.Message;
import com.android.email.provider.EmailContent.MessageColumns;
import com.android.email.provider.EmailContent.SyncColumns;
-import com.android.exchange.Eas;
import android.accounts.AccountManager;
import android.content.ContentProvider;
diff --git a/src/com/android/email/service/EasAuthenticatorService.java b/src/com/android/email/service/EasAuthenticatorService.java
index 3b47a8bfa..d8cf13caa 100644
--- a/src/com/android/email/service/EasAuthenticatorService.java
+++ b/src/com/android/email/service/EasAuthenticatorService.java
@@ -18,7 +18,6 @@ package com.android.email.service;
import com.android.email.Email;
import com.android.email.activity.setup.AccountSetupBasics;
-import com.android.exchange.Eas;
import android.accounts.AbstractAccountAuthenticator;
import android.accounts.Account;
diff --git a/tests/src/com/android/email/activity/setup/AccountSetupAccountTypeUnitTests.java b/tests/src/com/android/email/activity/setup/AccountSetupAccountTypeUnitTests.java
index d5c5d6277..13ea7551a 100644
--- a/tests/src/com/android/email/activity/setup/AccountSetupAccountTypeUnitTests.java
+++ b/tests/src/com/android/email/activity/setup/AccountSetupAccountTypeUnitTests.java
@@ -35,16 +35,16 @@ import java.util.HashSet;
* This is a series of unit tests for the AccountSetupAccountType class.
*/
@SmallTest
-public class AccountSetupAccountTypeUnitTests
+public class AccountSetupAccountTypeUnitTests
extends ActivityUnitTestCase