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

Commit db90ba16 authored by Katherine Kuan's avatar Katherine Kuan
Browse files

Fix for contact deletion on tablet

After deleting a contact, we incorrectly still show the
detail page and don't select a default contact in the contact
list.

If a contact is deleted, the ContactLookupTask will not be
able to find a lookup URI for the contact, but we should
still handle this null URI by setting it to the list
and trying to find a default contact to select instead.

Also remove the extra assignment of mSelectedContactUri.
We actually do that assignment in onContactUriQueryFinished().
This is the same way it was done in the original code before
this section was refactored in ICS MR1:
I85c748389921bdff2639fff5f7713e00ba7f9f8c

Bug: 5599721
Change-Id: Ib9b9221779a6828948553fe25fbeff982961c5ed
parent b3f36321
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -142,12 +142,13 @@ public abstract class ContactBrowseListFragment extends
        @Override
        protected void onPostExecute(Uri uri) {
            // Make sure the {@link Fragment} is at least still attached to the {@link Activity}
            // before continuing.
            if (mIsCancelled || !isAdded() || uri == null) {
            // before continuing. Null URIs should still be allowed so that the list can be
            // refreshed and a default contact can be selected (i.e. the case of deleted
            // contacts).
            if (mIsCancelled || !isAdded()) {
                return;
            }
            mSelectedContactUri = uri;
            onContactUriQueryFinished(mSelectedContactUri);
            onContactUriQueryFinished(uri);
        }
    }