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

Commit ed9fc5ff authored by Hemant Gupta's avatar Hemant Gupta Committed by android-build-merger
Browse files

Merge "OPP: Add local support for file transfer error text." am: cbce7b04

am: e864c1b8

Change-Id: Ib06f2b23325bbf01db694be32f6e5837e66ff9c5
parents 44b8e252 e864c1b8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -247,4 +247,5 @@
    <string name="bluetooth_connected">Bluetooth audio connected</string>
    <string name="bluetooth_disconnected">Bluetooth audio disconnected"</string>
    <string name="a2dp_sink_mbs_label">Bluetooth Audio</string>
    <string name="bluetooth_opp_file_limit_exceeded">Files bigger than 4GB cannot be transferred</string>
</resources>
+5 −3
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ import android.provider.OpenableColumns;
import android.util.EventLog;
import android.util.Log;

import com.android.bluetooth.R;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -224,9 +226,9 @@ public class BluetoothOppSendFileInfo {
            Log.e(TAG, "Could not determine size of file");
            return SEND_FILE_INFO_ERROR;
        } else if (length > 0xffffffffL) {
            String msg = "Files bigger than 4GB can't be transferred";
            Log.e(TAG, msg);
            throw new IllegalArgumentException(msg);
            Log.e(TAG, "File of size: " + length + " bytes can't be transferred");
            throw new IllegalArgumentException(context
                .getString(R.string.bluetooth_opp_file_limit_exceeded));
        }

        return new BluetoothOppSendFileInfo(fileName, contentType, length, is, 0);