Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24062f05 authored by Daisuke Teranishi's avatar Daisuke Teranishi Committed by android-build-merger
Browse files

Merge "Use correct filename when adding to ringtone"

am: daff857f

Change-Id: If0d096e7b33c84522c11077df04407ecc224fcf1
parents e770b169 daff857f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.database.Cursor;
import android.media.MediaScannerConnection.MediaScannerConnectionClient;
import android.net.Uri;
import android.os.Environment;
import android.os.FileUtils;
import android.os.IBinder;
import android.os.ParcelFileDescriptor;
import android.os.Process;
@@ -955,7 +956,8 @@ public class RingtoneManager {

        // 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);