am 254cc46e: am 02941b68: Merge "Hide software input when the Activity is closed." into mnc-dev
* commit '254cc46ea21106d2ebfc16da85d2156a65c1b8d8':
Hide software input when the Activity is closed.
diff --git a/src/com/android/contacts/ContactSaveService.java b/src/com/android/contacts/ContactSaveService.java
old mode 100644
new mode 100755
index 9944c77..df5c697
--- a/src/com/android/contacts/ContactSaveService.java
+++ b/src/com/android/contacts/ContactSaveService.java
@@ -322,6 +322,8 @@
serviceIntent.setAction(ContactSaveService.ACTION_SAVE_CONTACT);
serviceIntent.putExtra(EXTRA_CONTACT_STATE, (Parcelable) state);
serviceIntent.putExtra(EXTRA_SAVE_IS_PROFILE, isProfile);
+ serviceIntent.putExtra(EXTRA_SAVE_MODE, saveMode);
+
if (updatedPhotos != null) {
serviceIntent.putExtra(EXTRA_UPDATED_PHOTOS, (Parcelable) updatedPhotos);
}
@@ -353,6 +355,7 @@
return;
}
+ int saveMode = intent.getIntExtra(EXTRA_SAVE_MODE, -1);
// Trim any empty fields, and RawContacts, before persisting
final AccountTypeManager accountTypes = AccountTypeManager.getInstance(this);
RawContactModifier.trimEmpty(state, accountTypes);
@@ -491,7 +494,7 @@
}
// If the save failed, insertedRawContactId will be -1
- if (rawContactId < 0 || !saveUpdatedPhoto(rawContactId, photoUri)) {
+ if (rawContactId < 0 || !saveUpdatedPhoto(rawContactId, photoUri, saveMode)) {
succeeded = false;
}
}
@@ -514,12 +517,12 @@
* Save updated photo for the specified raw-contact.
* @return true for success, false for failure
*/
- private boolean saveUpdatedPhoto(long rawContactId, Uri photoUri) {
+ private boolean saveUpdatedPhoto(long rawContactId, Uri photoUri, int saveMode) {
final Uri outputUri = Uri.withAppendedPath(
ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId),
RawContacts.DisplayPhoto.CONTENT_DIRECTORY);
- return ContactPhotoUtils.savePhotoFromUriToUri(this, photoUri, outputUri, true);
+ return ContactPhotoUtils.savePhotoFromUriToUri(this, photoUri, outputUri, (saveMode == 0));
}
/**