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

Commit e864c1b8 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

Change-Id: I2e7d4d586d653aa99d95110ed8238287f9659778
parents 9469d04f cbce7b04
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);