summaryrefslogtreecommitdiffstats
path: root/src/com/android/contacts/ContactSaveService.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/contacts/ContactSaveService.java')
-rw-r--r--src/com/android/contacts/ContactSaveService.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/contacts/ContactSaveService.java b/src/com/android/contacts/ContactSaveService.java
index 29a4a7b39..9944c77c6 100644
--- a/src/com/android/contacts/ContactSaveService.java
+++ b/src/com/android/contacts/ContactSaveService.java
@@ -54,6 +54,7 @@ import com.android.contacts.common.model.RawContactDelta;
import com.android.contacts.common.model.RawContactDeltaList;
import com.android.contacts.common.model.RawContactModifier;
import com.android.contacts.common.model.account.AccountWithDataSet;
+import com.android.contacts.editor.ContactEditorFragment;
import com.android.contacts.util.ContactPhotoUtils;
import com.google.common.collect.Lists;
@@ -300,7 +301,7 @@ public class ContactSaveService extends IntentService {
Bundle bundle = new Bundle();
bundle.putParcelable(String.valueOf(rawContactId), updatedPhotoPath);
return createSaveContactIntent(context, state, saveModeExtraKey, saveMode, isProfile,
- callbackActivity, callbackAction, bundle);
+ callbackActivity, callbackAction, bundle, /* backPressed =*/ false);
}
/**
@@ -309,11 +310,13 @@ public class ContactSaveService extends IntentService {
* This variant is used when multiple contacts' photos may be updated, as in the
* Contact Editor.
* @param updatedPhotos maps each raw-contact's ID to the file-path of the new photo.
+ * @param backPressed whether the save was initiated as a result of a back button press
+ * or because the framework stopped the editor Activity
*/
public static Intent createSaveContactIntent(Context context, RawContactDeltaList state,
String saveModeExtraKey, int saveMode, boolean isProfile,
Class<? extends Activity> callbackActivity, String callbackAction,
- Bundle updatedPhotos) {
+ Bundle updatedPhotos, boolean backPressed) {
Intent serviceIntent = new Intent(
context, ContactSaveService.class);
serviceIntent.setAction(ContactSaveService.ACTION_SAVE_CONTACT);
@@ -333,6 +336,8 @@ public class ContactSaveService extends IntentService {
if (updatedPhotos != null) {
callbackIntent.putExtra(EXTRA_UPDATED_PHOTOS, (Parcelable) updatedPhotos);
}
+ callbackIntent.putExtra(ContactEditorFragment.INTENT_EXTRA_SAVE_BACK_PRESSED,
+ backPressed);
serviceIntent.putExtra(ContactSaveService.EXTRA_CALLBACK_INTENT, callbackIntent);
}
return serviceIntent;