Avoid showing error if contact removed on save.
Because removing all data from a local contact can actually cause
the raw contact and contact to be deleted, we need to track that
case so that the caller does not consider the lack of a lookup
URI to be an error.
Also made "Me" header all-caps for no-profile case.
Bug 5346614
Bug 5354364
Change-Id: If1e1d67da9c14eb8782be05b2e39ece19b5ac026
diff --git a/src/com/android/contacts/ContactSaveService.java b/src/com/android/contacts/ContactSaveService.java
index 2697589..be84cc4 100644
--- a/src/com/android/contacts/ContactSaveService.java
+++ b/src/com/android/contacts/ContactSaveService.java
@@ -79,6 +79,7 @@
public static final String EXTRA_CONTACT_STATE = "state";
public static final String EXTRA_SAVE_MODE = "saveMode";
public static final String EXTRA_SAVE_IS_PROFILE = "saveIsProfile";
+ public static final String EXTRA_SAVE_SUCCEEDED = "saveSucceeded";
public static final String ACTION_CREATE_GROUP = "createGroup";
public static final String ACTION_RENAME_GROUP = "renameGroup";
@@ -345,6 +346,10 @@
lookupUri = RawContacts.getContactLookupUri(resolver, rawContactUri);
}
Log.v(TAG, "Saved contact. New URI: " + lookupUri);
+ // Mark the intent to indicate that the save was successful (even if the lookup URI
+ // is now null). For local contacts or the local profile, it's possible that the
+ // save triggered removal of the contact, so no lookup URI would exist..
+ callbackIntent.putExtra(EXTRA_SAVE_SUCCEEDED, true);
break;
} catch (RemoteException e) {