summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Attwell <brianattwell@google.com>2014-10-16 21:01:21 -0700
committerBrian Attwell <brianattwell@google.com>2014-10-16 21:01:21 -0700
commit930da3ae6e392777986ed0722c5480caf1bd9e7e (patch)
tree7ce14f720661786b9b0d53f985c5570940c4adea /src
parent711c3440e01df8fc0a94fbc411195184d9d7cdfc (diff)
downloadpackages_apps_Contacts-930da3ae6e392777986ed0722c5480caf1bd9e7e.tar.gz
packages_apps_Contacts-930da3ae6e392777986ed0722c5480caf1bd9e7e.tar.bz2
packages_apps_Contacts-930da3ae6e392777986ed0722c5480caf1bd9e7e.zip
Call finish() in QC if contact doesn't exist
Bug: 17946654 Change-Id: I1550b1007c4daaa1022297556831db7bedcbaac0
Diffstat (limited to 'src')
-rw-r--r--src/com/android/contacts/quickcontact/QuickContactActivity.java32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index e5574d90f..5afa022d6 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -1760,29 +1760,29 @@ public class QuickContactActivity extends ContactsActivity {
@Override
public void onLoadFinished(Loader<Contact> loader, Contact data) {
Trace.beginSection("onLoadFinished()");
+ try {
- if (isFinishing()) {
- return;
- }
- if (data.isError()) {
- // This shouldn't ever happen, so throw an exception. The {@link ContactLoader}
- // should log the actual exception.
- throw new IllegalStateException("Failed to load contact", data.getException());
- }
- if (data.isNotFound()) {
- if (mHasAlreadyBeenOpened) {
- finish();
- } else {
+ if (isFinishing()) {
+ return;
+ }
+ if (data.isError()) {
+ // This shouldn't ever happen, so throw an exception. The {@link ContactLoader}
+ // should log the actual exception.
+ throw new IllegalStateException("Failed to load contact", data.getException());
+ }
+ if (data.isNotFound()) {
Log.i(TAG, "No contact found: " + ((ContactLoader)loader).getLookupUri());
Toast.makeText(QuickContactActivity.this, R.string.invalidContactMessage,
Toast.LENGTH_LONG).show();
+ finish();
+ return;
}
- return;
- }
- bindContactData(data);
+ bindContactData(data);
- Trace.endSection();
+ } finally {
+ Trace.endSection();
+ }
}
@Override