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

Commit c8693e4a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Bluetooth-OPP: Enable support to send multiple files"

parents b5ff6942 ef90053d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -611,7 +611,7 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession {
            } finally {
                try {
                    // Close InputStream and remove SendFileInfo from map
                    BluetoothOppUtility.closeSendFileInfo(mInfo.mUri);
                    BluetoothOppUtility.closeSendFileInfo(mInfo.mUri, fileInfo);

                    if (uiUpdateThread != null) {
                        uiUpdateThread.interrupt ();
+1 −1
Original line number Diff line number Diff line
@@ -719,7 +719,7 @@ public class BluetoothOppService extends Service {
                if (sendFileInfo == null || sendFileInfo.mInputStream == null) {
                    Log.e(TAG, "Can't open file for OUTBOUND info " + info.mId);
                    Constants.updateShareStatus(this, info.mId, BluetoothShare.STATUS_BAD_REQUEST);
                    BluetoothOppUtility.closeSendFileInfo(info.mUri);
                    BluetoothOppUtility.closeSendFileInfo(info.mUri, sendFileInfo);
                    return;
                }
            }
+1 −1
Original line number Diff line number Diff line
@@ -351,7 +351,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
                if (info.mDirection == BluetoothShare.DIRECTION_OUTBOUND) {
                    BluetoothOppSendFileInfo fileInfo
                            = BluetoothOppUtility.getSendFileInfo(info.mUri);
                    BluetoothOppUtility.closeSendFileInfo(info.mUri);
                    BluetoothOppUtility.closeSendFileInfo(info.mUri, fileInfo);
                    if (fileInfo.mFileName != null) {
                        updateValues.put(BluetoothShare.FILENAME_HINT, fileInfo.mFileName);
                        updateValues.put(BluetoothShare.TOTAL_BYTES, fileInfo.mLength);
+5 −5
Original line number Diff line number Diff line
@@ -334,12 +334,12 @@ public class BluetoothOppUtility {
        return (info != null) ? info : BluetoothOppSendFileInfo.SEND_FILE_INFO_ERROR;
    }

    static void closeSendFileInfo(Uri uri) {
        if (D) Log.d(TAG, "closeSendFileInfo: uri=" + uri);
        BluetoothOppSendFileInfo info = sSendFileMap.remove(uri);
        if (info != null && info.mInputStream != null) {
    static void closeSendFileInfo(Uri uri, BluetoothOppSendFileInfo sendFileInfo) {
        if (D) Log.d(TAG, "closeSendFileInfo: uri=" + uri + "sendFileInfo: " + sendFileInfo);
        boolean removed = sSendFileMap.remove(uri, sendFileInfo);
        if (removed && sendFileInfo != null && sendFileInfo.mInputStream != null) {
            try {
                info.mInputStream.close();
                sendFileInfo.mInputStream.close();
            } catch (IOException ignored) {
            }
        }