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

Commit af529cfb authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge e0d4a2d0 on remote branch

Change-Id: Ibc3128d72f30f8e2dee8d62aa237a4249d72f0e1
parents af3e9dea e0d4a2d0
Loading
Loading
Loading
Loading
+17 −11
Original line number Diff line number Diff line
@@ -253,11 +253,13 @@ public class BluetoothOppManager {
        synchronized (BluetoothOppManager.this) {
            mMultipleFlag = false;
            mMimeTypeOfSendingFile = mimeType;
            mUriOfSendingFile = uriString;
            mIsHandoverInitiated = isHandover;
            Uri uri = Uri.parse(uriString);
            BluetoothOppUtility.putSendFileInfo(uri,
                    BluetoothOppSendFileInfo.generateFileInfo(mContext, uri, mimeType));
            BluetoothOppSendFileInfo sendFileInfo =
                BluetoothOppSendFileInfo.generateFileInfo(mContext, uri, mimeType);
            uri = BluetoothOppUtility.generateUri(uri, sendFileInfo);
            BluetoothOppUtility.putSendFileInfo(uri, sendFileInfo);
            mUriOfSendingFile = uri.toString();
            storeApplicationData();
        }
    }
@@ -266,11 +268,14 @@ public class BluetoothOppManager {
        synchronized (BluetoothOppManager.this) {
            mMultipleFlag = true;
            mMimeTypeOfSendingFiles = mimeType;
            mUrisOfSendingFiles = uris;
            mUrisOfSendingFiles = new ArrayList<Uri>();
            mIsHandoverInitiated = isHandover;
            for (Uri uri : uris) {
                BluetoothOppUtility.putSendFileInfo(uri,
                        BluetoothOppSendFileInfo.generateFileInfo(mContext, uri, mimeType));
                BluetoothOppSendFileInfo sendFileInfo =
                    BluetoothOppSendFileInfo.generateFileInfo(mContext, uri, mimeType);
                uri = BluetoothOppUtility.generateUri(uri, sendFileInfo);
                mUrisOfSendingFiles.add(uri);
                BluetoothOppUtility.putSendFileInfo(uri, sendFileInfo);
            }
            storeApplicationData();
        }
@@ -429,17 +434,18 @@ public class BluetoothOppManager {
            Long ts = System.currentTimeMillis();
            for (int i = 0; i < count; i++) {
                Uri fileUri = mUris.get(i);

                BluetoothOppSendFileInfo fileInfo = BluetoothOppUtility.getSendFileInfo(fileUri);
                ContentValues values = new ContentValues();
                values.put(BluetoothShare.URI, fileUri.toString());

                ContentResolver contentResolver = mContext.getContentResolver();
                fileUri = BluetoothOppUtility.originalUri(fileUri);
                String contentType = contentResolver.getType(fileUri);
                if (V) Log.v(TAG, "Got mimetype: " + contentType + "  Got uri: " + fileUri);
                if (TextUtils.isEmpty(contentType)) {
                    contentType = mTypeOfMultipleFiles;
                }

                BluetoothOppSendFileInfo fileInfo = BluetoothOppSendFileInfo.generateFileInfo(
                mContext, fileUri, contentType);
                ContentValues values = new ContentValues();
                values.put(BluetoothShare.URI, fileUri.toString());
                values.put(BluetoothShare.MIMETYPE, contentType);
                values.put(BluetoothShare.DESTINATION, mRemoteDevice.getAddress());
                values.put(BluetoothShare.TIMESTAMP, ts);
+1 −1
Original line number Diff line number Diff line
@@ -610,7 +610,7 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession {
            } finally {
                try {
                    // Close InputStream and remove SendFileInfo from map
                    BluetoothOppUtility.closeSendFileInfo(mInfo.mUri, fileInfo);
                    BluetoothOppUtility.closeSendFileInfo(mInfo.mUri);

                    if (uiUpdateThread != null) {
                        uiUpdateThread.interrupt ();
+1 −1
Original line number Diff line number Diff line
@@ -706,7 +706,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, sendFileInfo);
                    BluetoothOppUtility.closeSendFileInfo(info.mUri);
                    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, fileInfo);
                    BluetoothOppUtility.closeSendFileInfo(info.mUri);
                    if (fileInfo.mFileName != null) {
                        updateValues.put(BluetoothShare.FILENAME_HINT, fileInfo.mFileName);
                        updateValues.put(BluetoothShare.TOTAL_BYTES, fileInfo.mLength);
+6 −3
Original line number Diff line number Diff line
@@ -371,10 +371,13 @@ public class BluetoothOppTransferActivity extends AlertActivity implements
                            .cancel(mTransInfo.mID);

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

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

Loading