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

Commit 930da3ae authored by Brian Attwell's avatar Brian Attwell
Browse files

Call finish() in QC if contact doesn't exist

Bug: 17946654
Change-Id: I1550b1007c4daaa1022297556831db7bedcbaac0
parent 711c3440
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -1760,6 +1760,7 @@ public class QuickContactActivity extends ContactsActivity {
        @Override
        public void onLoadFinished(Loader<Contact> loader, Contact data) {
            Trace.beginSection("onLoadFinished()");
            try {

                if (isFinishing()) {
                    return;
@@ -1770,20 +1771,19 @@ public class QuickContactActivity extends ContactsActivity {
                    throw new IllegalStateException("Failed to load contact", data.getException());
                }
                if (data.isNotFound()) {
                if (mHasAlreadyBeenOpened) {
                    finish();
                } else {
                    Log.i(TAG, "No contact found: " + ((ContactLoader)loader).getLookupUri());
                    Toast.makeText(QuickContactActivity.this, R.string.invalidContactMessage,
                            Toast.LENGTH_LONG).show();
                }
                    finish();
                    return;
                }

                bindContactData(data);

            } finally {
                Trace.endSection();
            }
        }

        @Override
        public Loader<Contact> onCreateLoader(int id, Bundle args) {