summaryrefslogtreecommitdiffstats
path: root/src/com/android/contacts/common/vcard/VCardService.java
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-03-24 13:36:45 -0700
committerSteve Kondik <steve@cyngn.com>2015-03-25 03:25:09 -0700
commit90b89eda4c38deeb39a0c961b8149a04d553051b (patch)
tree2988137a54c868d49cae08a99a86bbf36912ba88 /src/com/android/contacts/common/vcard/VCardService.java
parent516b8b57f2a445afe1b1ef212e9abfa4549a13c7 (diff)
parent7c27248f86795222adc8b87543eda5c6148610db (diff)
downloadandroid_packages_apps_ContactsCommon-90b89eda4c38deeb39a0c961b8149a04d553051b.tar.gz
android_packages_apps_ContactsCommon-90b89eda4c38deeb39a0c961b8149a04d553051b.tar.bz2
android_packages_apps_ContactsCommon-90b89eda4c38deeb39a0c961b8149a04d553051b.zip
Merge branch 'lollipop-mr1-release' of https://android.googlesource.com/platform/packages/apps/ContactsCommon into cm-12.1
Change-Id: I271972eb6db4d6c5cc620a1adb26b1f06beaf1b4
Diffstat (limited to 'src/com/android/contacts/common/vcard/VCardService.java')
-rw-r--r--src/com/android/contacts/common/vcard/VCardService.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/contacts/common/vcard/VCardService.java b/src/com/android/contacts/common/vcard/VCardService.java
index f11598a1..7b90eddb 100644
--- a/src/com/android/contacts/common/vcard/VCardService.java
+++ b/src/com/android/contacts/common/vcard/VCardService.java
@@ -38,6 +38,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
+import java.util.Locale;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -496,7 +497,8 @@ public class VCardService extends Service {
* This method increments "index" part from 1 to maximum, and checks whether any file name
* following naming rule is available. If there's no file named /mnt/sdcard/00001.vcf, the
* name will be returned to a caller. If there are 00001.vcf 00002.vcf, 00003.vcf is
- * returned.
+ * returned. We format these numbers in the US locale to ensure we they appear as
+ * english numerals.
*
* There may not be any appropriate file name. If there are 99999 vCard files in the
* storage, for example, there's no appropriate name, so this method returns
@@ -519,7 +521,7 @@ public class VCardService extends Service {
if (!ALLOW_LONG_FILE_NAME) {
final String possibleBody =
- String.format(bodyFormat, mFileNamePrefix, 1, mFileNameSuffix);
+ String.format(Locale.US, bodyFormat, mFileNamePrefix, 1, mFileNameSuffix);
if (possibleBody.length() > 8 || mFileNameExtension.length() > 3) {
Log.e(LOG_TAG, "This code does not allow any long file name.");
mErrorReason = getString(R.string.fail_reason_too_long_filename,
@@ -531,7 +533,8 @@ public class VCardService extends Service {
for (int i = mFileIndexMinimum; i <= mFileIndexMaximum; i++) {
boolean numberIsAvailable = true;
- final String body = String.format(bodyFormat, mFileNamePrefix, i, mFileNameSuffix);
+ final String body
+ = String.format(Locale.US, bodyFormat, mFileNamePrefix, i, mFileNameSuffix);
// Make sure that none of the extensions of mExtensionsToConsider matches. If this
// number is free, we'll go ahead with mFileNameExtension (which is included in
// mExtensionsToConsider)