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

Commit 0e85349f authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "OPP: append timestamp to the file name" am: babfd2ee

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Bluetooth/+/1396233

Change-Id: I2a1aecf328d4b5011b4e711f15c6ebe9072f4aed
parents 9c62b066 babfd2ee
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);