diff options
author | wangjing <wangjing@codeaurora.org> | 2015-04-13 15:32:26 +0800 |
---|---|---|
committer | wangjing <wangjing@codeaurora.org> | 2015-04-13 15:32:26 +0800 |
commit | 63fce00e8cefd20c94d4d2fd938177e030f79405 (patch) | |
tree | f829b3b22dfe2d55c218763ff125f6b67f4450d7 | |
parent | 9cad9b31c96fb9be06efc39a786c83d2ea5f639b (diff) | |
download | android_packages_apps_ContactsCommon-63fce00e8cefd20c94d4d2fd938177e030f79405.tar.gz android_packages_apps_ContactsCommon-63fce00e8cefd20c94d4d2fd938177e030f79405.tar.bz2 android_packages_apps_ContactsCommon-63fce00e8cefd20c94d4d2fd938177e030f79405.zip |
Contacts: Can not export contacts to SIM card properly
If failed to export contact to SIM card, it does not reset
emptyNumber and emptyEmail to the value before the insert
operation, as a result, we can not export contacts to SIM
properly.
When failed to export contact to SIM and try to continue the
loop, we should reset emptyNumber and emptyAnr and emptyEmail
to the value before the insert operation.
Change-Id: I8ac8631de0e3feae89cb8e2052e65b4dd4e2cf8d
CRs-Fixed: 811721
-rwxr-xr-x | src/com/android/contacts/common/interactions/ImportExportDialogFragment.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java b/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java index ef99300a..63fe01d6 100755 --- a/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java +++ b/src/com/android/contacts/common/interactions/ImportExportDialogFragment.java @@ -580,6 +580,26 @@ public class ImportExportDialogFragment extends AnalyticsDialogFragment TOAST_EXPORT_FAILED, insertCount, 0)); break; } else { + // Failed to insert to SIM card + int anrNumber = 0; + if (!TextUtils.isEmpty(anrNum)) { + anrNumber += anrNum.toString().split( + SimContactsConstants.ANR_SEP).length; + } + // reset emptyNumber and emptyAnr to the value before + // the insert operation + emptyAnr += anrNumber; + emptyNumber += anrNumber; + if (!TextUtils.isEmpty(num)) { + emptyNumber++; + } + + if (!TextUtils.isEmpty(email)) { + // reset emptyEmail to the value before the insert + // operation + emptyEmail += email.toString().split( + SimContactsConstants.EMAIL_SEP).length; + } continue; } } |