From 5aa3d71209130bc3189440523d51dc4615446bbc Mon Sep 17 00:00:00 2001 From: Ben Komalo Date: Wed, 20 Jul 2011 10:37:48 -0700 Subject: [PATCH] Prevent search on POP We were hiding the search icon from the actionbar but didn't take into account the use of a hardware button. Bug: 5051691 Change-Id: I2e0bfd1d0bb4faa3238e567c02189894db5f6c44 --- .../android/email/activity/UIControllerBase.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/com/android/email/activity/UIControllerBase.java b/src/com/android/email/activity/UIControllerBase.java index fc937d958..0ec907c7f 100644 --- a/src/com/android/email/activity/UIControllerBase.java +++ b/src/com/android/email/activity/UIControllerBase.java @@ -623,6 +623,20 @@ abstract class UIControllerBase implements MailboxListFragment.Callback, * is actually submitted. */ 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()) { mActionBarController.enterSearchMode(null); }