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

Commit ab22b826 authored by Brian Attwell's avatar Brian Attwell Committed by Android (Google) Code Review
Browse files

Merge "Call finish() in QC if contact doesn't exist" into lmp-mr1-dev

parents b9bd549d 930da3ae
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -1903,6 +1903,7 @@ public class QuickContactActivity extends ContactsActivity {
        @Override
        public void onLoadFinished(Loader<Contact> loader, Contact data) {
            Trace.beginSection("onLoadFinished()");
            try {

                if (isFinishing()) {
                    return;
@@ -1913,20 +1914,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) {