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

Commit 28d0d454 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[DO NOT MERGE] OPP: append timestamp to the file name" into rvc-qpr-dev

parents 67c54c62 cfbcafc8
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -42,6 +42,9 @@ import android.provider.MediaStore;
import android.util.Log;

import java.io.UnsupportedEncodingException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * This class stores information about a single receiving file. It will only be
@@ -53,8 +56,8 @@ public class BluetoothOppReceiveFileInfo {
    private static final boolean V = Constants.VERBOSE;
    private static String sDesiredStoragePath = null;

    /* To truncate the name of the received file if the length exceeds 245 */
    private static final int OPP_LENGTH_OF_FILE_NAME = 244;
    /* To truncate the name of the received file if the length exceeds 237 */
    private static final int OPP_LENGTH_OF_FILE_NAME = 237;


    /** absolute store file name */
@@ -160,7 +163,9 @@ public class BluetoothOppReceiveFileInfo {
            }
        }

        String fullfilename = filename + extension;
        DateFormat dateFormat = new SimpleDateFormat("_hhmmss");
        String currentTime = dateFormat.format(Calendar.getInstance().getTime());
        String fullfilename = filename + currentTime + extension;

        if (V) {
            Log.v(Constants.TAG, "Generated received filename " + fullfilename);