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

Commit 223b23a7 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5910202 from c3700300 to rvc-release

Change-Id: Ib77b5f6905c33412675fab7be40f2fb5736ba116
parents 42bc7a05 c3700300
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -474,7 +474,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
            mBatch.mStatus = Constants.BATCH_STATUS_FAILED;
            return;
        }

        registerConnectionreceiver();
        if (mHandlerThread == null) {
            if (V) {
                Log.v(TAG, "Create handler thread for batch " + mBatch.mId);
@@ -495,7 +495,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
                startObexSession();
            }
        }
        registerConnectionreceiver();

    }

    /**
+20 −12
Original line number Diff line number Diff line
@@ -375,24 +375,13 @@ public class BluetoothOppTransferActivity extends AlertActivity
                            mTransInfo.mID);
                } else if (mWhichDialog == DIALOG_SEND_COMPLETE_FAIL) {
                    // "try again"

                    // make current transfer "hidden"
                    BluetoothOppUtility.updateVisibilityToHidden(this, mUri);

                    // clear correspondent notification item
                    ((NotificationManager) getSystemService(NOTIFICATION_SERVICE)).cancel(
                            mTransInfo.mID);

                    // retry the failed transfer
                    Uri uri = BluetoothOppUtility.originalUri(Uri.parse(mTransInfo.mFileUri));
                    BluetoothOppSendFileInfo sendFileInfo =
                            BluetoothOppSendFileInfo.generateFileInfo(BluetoothOppTransferActivity
                            .this, uri, mTransInfo.mFileType, false);
                    uri = BluetoothOppUtility.generateUri(uri, sendFileInfo);
                    BluetoothOppUtility.putSendFileInfo(uri, sendFileInfo);
                    mTransInfo.mFileUri = uri.toString();
                    BluetoothOppUtility.retryTransfer(this, mTransInfo);

                    retryFailedTrasfer();
                    BluetoothDevice remoteDevice = mAdapter.getRemoteDevice(mTransInfo.mDestAddr);

                    // Display toast message
@@ -502,4 +491,23 @@ public class BluetoothOppTransferActivity extends AlertActivity
                    .setText(getString(R.string.upload_fail_cancel));
        }
    }

   /*
    * Retry the failed transfer in background thread
    */
   private void retryFailedTrasfer() {
        new Thread() {
            @Override
            public void run() {
                Uri uri = BluetoothOppUtility.originalUri(Uri.parse(mTransInfo.mFileUri));
                BluetoothOppSendFileInfo sendFileInfo =
                        BluetoothOppSendFileInfo.generateFileInfo(BluetoothOppTransferActivity
                        .this, uri, mTransInfo.mFileType, false);
                uri = BluetoothOppUtility.generateUri(uri, sendFileInfo);
                BluetoothOppUtility.putSendFileInfo(uri, sendFileInfo);
                mTransInfo.mFileUri = uri.toString();
                BluetoothOppUtility.retryTransfer(BluetoothOppTransferActivity.this, mTransInfo);
            }
        }.start();
    }
}