Merge "Use correct filename when adding to ringtone" am: daff857ffd
am: 24062f05d3
Change-Id: Id9d89491c5604b1611b22f215827f55de98f8ac2
diff --git a/media/java/android/media/RingtoneManager.java b/media/java/android/media/RingtoneManager.java
index fefa1ed..0dddaf5 100644
--- a/media/java/android/media/RingtoneManager.java
+++ b/media/java/android/media/RingtoneManager.java
@@ -952,7 +952,8 @@
// Find a filename. Throws FileNotFoundException if none can be found.
final File outFile = Utils.getUniqueExternalFile(mContext, subdirectory,
- Utils.getFileDisplayNameFromUri(mContext, fileUri), mimeType);
+ FileUtils.buildValidFatFilename(Utils.getFileDisplayNameFromUri(mContext, fileUri)),
+ mimeType);
// Copy contents to external ringtone storage. Throws IOException if the copy fails.
try (final InputStream input = mContext.getContentResolver().openInputStream(fileUri);