Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3af2d48a authored by Chiao Cheng's avatar Chiao Cheng
Browse files

Prevent going into single contact mode un-necessarily.

On a tablet, after creating a new contact, the contact list would enter
"single contact mode". This mode is intended for the case where you may
have an account filte set and you want to see a contact in a different
account.  Combined with a stale contact list, this caused the app to
go into single mode when it was not necessary.

This will fix the most common case where all accounts are shown and a
new contact is added. The new contact will be displayed in the normal list.

This will not fix the case where an account filter is active and a new
contact is created.  In this case, the new contact is still displayed in
single contact mode.

Also tested was the test cases in:
I233162572e25acb737c9eae787dfc146879a0dc2

Bug: 7621855
Change-Id: I6f323c4003677cec9db63cae347f4532071037b9
parent 1c9e54ba
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -490,8 +490,15 @@ public abstract class ContactBrowseListFragment extends
                mSelectionRequired = false;

                // If we were looking at a different specific contact, just reload
                // FILTER_TYPE_ALL_ACCOUNTS is needed for the case where a new contact is added
                // on a tablet and the loader is returning a stale list.  In this case, the contact
                // will not be found until the next load. b/7621855 This will only fix the most
                // common case where all accounts are shown. It will not fix the one account case.
                // TODO: we may want to add more FILTER_TYPEs or relax this check to fix all other
                // FILTER_TYPE cases.
                if (mFilter != null
                        && mFilter.filterType == ContactListFilter.FILTER_TYPE_SINGLE_CONTACT) {
                        && (mFilter.filterType == ContactListFilter.FILTER_TYPE_SINGLE_CONTACT
                        || mFilter.filterType == ContactListFilter.FILTER_TYPE_ALL_ACCOUNTS)) {
                    reloadData();
                } else {
                    // Otherwise, call the listener, which will adjust the filter.