summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwangjing <wangjing@codeaurora.org>2015-04-13 15:32:26 +0800
committerwangjing <wangjing@codeaurora.org>2015-04-13 15:32:26 +0800
commit63fce00e8cefd20c94d4d2fd938177e030f79405 (patch)
treef829b3b22dfe2d55c218763ff125f6b67f4450d7
parent9cad9b31c96fb9be06efc39a786c83d2ea5f639b (diff)
downloadandroid_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-xsrc/com/android/contacts/common/interactions/ImportExportDialogFragment.java20
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;
}
}