From f62fd3fd177a79579cde30e43a85eb9709eb348b Mon Sep 17 00:00:00 2001 From: Ben Komalo Date: Fri, 17 Jun 2011 11:33:02 -0700 Subject: [PATCH] ensure that search mailboxes don't have parents This causes issues in the mailbox list when trying to auto navigate to a search mailbox Change-Id: Ie4e43f20ec662a7c9304dd906ba5a58560cba9f5 --- src/com/android/email/Controller.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/Controller.java b/src/com/android/email/Controller.java index 98d6c561a..2069481bf 100644 --- a/src/com/android/email/Controller.java +++ b/src/com/android/email/Controller.java @@ -271,6 +271,7 @@ public class Controller { m.mSyncInterval = Mailbox.CHECK_INTERVAL_NEVER; m.mType = Mailbox.TYPE_SEARCH; m.mFlags = Mailbox.FLAG_HOLDS_MAIL; + m.mParentKey = Mailbox.NO_MAILBOX; m.save(mProviderContext); } return m; @@ -911,7 +912,11 @@ public class Controller { } else { // This is the actual mailbox we'll be searching Mailbox actualMailbox = Mailbox.restoreMailboxWithId(mContext, searchParams.mMailboxId); - if (actualMailbox == null) return; + if (actualMailbox == null) { + Log.e(Logging.LOG_TAG, "Unable to find mailbox " + searchParams.mMailboxId + + " to search in with " + searchParams); + return; + } // Delete existing contents of search mailbox ContentResolver resolver = mContext.getContentResolver();