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

Commit 599ff234 authored by Jaikumar Ganesh's avatar Jaikumar Ganesh Committed by Android Git Automerger
Browse files

am 2ce242db: Catch all exceptions while trying to send a file.

Merge commit '2ce242db' into eclair-mr2

* commit '2ce242db':
  Catch all exceptions while trying to send a file.
parents 2640f28b 2ce242db
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -571,13 +571,21 @@ public class BluetoothOppService extends Service {
        if (info.isReadyToStart()) {
            if (info.mDirection == BluetoothShare.DIRECTION_OUTBOUND) {
                /* check if the file exists */
                InputStream i;
                try {
                    InputStream i = getContentResolver().openInputStream(Uri.parse(info.mUri));
                    i.close();
                    i = getContentResolver().openInputStream(Uri.parse(info.mUri));
                } catch (FileNotFoundException e) {
                    Log.e(TAG, "Can't open file for OUTBOUND info " + info.mId);
                    Constants.updateShareStatus(this, info.mId, BluetoothShare.STATUS_BAD_REQUEST);
                    return;
                } catch (SecurityException e) {
                    Log.e(TAG, "Exception:" + e.toString() + " for OUTBOUND info " + info.mId);
                    Constants.updateShareStatus(this, info.mId, BluetoothShare.STATUS_BAD_REQUEST);
                    return;
                }

                try {
                    i.close();
                } catch (IOException ex) {
                    Log.e(TAG, "IO error when close file for OUTBOUND info " + info.mId);
                    return;