Loading src/com/android/bluetooth/opp/BluetoothOppManager.java +17 −11 Original line number Diff line number Diff line Loading @@ -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(); } } Loading @@ -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(); } Loading Loading @@ -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); Loading src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java +1 −1 Original line number Diff line number Diff line Loading @@ -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 (); Loading src/com/android/bluetooth/opp/BluetoothOppService.java +1 −1 Original line number Diff line number Diff line Loading @@ -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; } } Loading src/com/android/bluetooth/opp/BluetoothOppTransfer.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); Loading src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java +6 −3 Original line number Diff line number Diff line Loading @@ -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 Loading
src/com/android/bluetooth/opp/BluetoothOppManager.java +17 −11 Original line number Diff line number Diff line Loading @@ -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(); } } Loading @@ -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(); } Loading Loading @@ -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); Loading
src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java +1 −1 Original line number Diff line number Diff line Loading @@ -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 (); Loading
src/com/android/bluetooth/opp/BluetoothOppService.java +1 −1 Original line number Diff line number Diff line Loading @@ -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; } } Loading
src/com/android/bluetooth/opp/BluetoothOppTransfer.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); Loading
src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java +6 −3 Original line number Diff line number Diff line Loading @@ -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