Merge "Prevent search on POP"

This commit is contained in:
Ben Komalo 2011-07-20 11:06:56 -07:00 committed by Android (Google) Code Review
commit 6496562610

View File

@ -623,6 +623,20 @@ abstract class UIControllerBase implements MailboxListFragment.Callback,
* is actually submitted. * is actually submitted.
*/ */
public void onSearchRequested() { public void onSearchRequested() {
long accountId = getActualAccountId();
boolean accountSearchable = false;
if (accountId > 0) {
Account account = Account.restoreAccountWithId(mActivity, accountId);
if (account != null) {
String protocol = account.getProtocol(mActivity);
accountSearchable = (account.mFlags & Account.FLAGS_SUPPORTS_SEARCH) != 0;
}
}
if (!accountSearchable) {
return;
}
if (isMessageListReady()) { if (isMessageListReady()) {
mActionBarController.enterSearchMode(null); mActionBarController.enterSearchMode(null);
} }