&& BluetoothShare.isStatusSuccess(transInfo.mStatus)) {
// if received file successfully, open this file
BluetoothOppUtility.openReceivedFile(context, transInfo.mFileName,
- transInfo.mFileType, transInfo.mTimeStamp);
+ transInfo.mFileType, transInfo.mTimeStamp, uri);
BluetoothOppUtility.updateVisibilityToHidden(context, uri);
} else {
Intent in = new Intent(context, BluetoothOppTransferActivity.class);
if (mWhichDialog == DIALOG_RECEIVE_COMPLETE_SUCCESS) {
// "Open" - open receive file
BluetoothOppUtility.openReceivedFile(this, mTransInfo.mFileName,
- mTransInfo.mFileType, mTransInfo.mTimeStamp);
+ mTransInfo.mFileType, mTransInfo.mTimeStamp, mUri);
// make current transfer "hidden"
BluetoothOppUtility.updateVisibilityToHidden(this, mUri);
* application to handle, display error dialog.
*/
public static void openReceivedFile(Context context, String fileName, String mimetype,
- Long timeStamp) {
+ Long timeStamp, Uri uri) {
if (fileName == null || mimetype == null) {
Log.e(TAG, "ERROR: Para fileName ==null, or mimetype == null");
return;
in.putExtra("title", context.getString(R.string.not_exist_file));
in.putExtra("content", context.getString(R.string.not_exist_file_desc));
context.startActivity(in);
+
+ // Due to the file is not existing, delete related info in btopp db
+ // to prevent this file from appearing in live folder
+ if (V) Log.d(TAG, "This uri will be deleted: " + uri);
+ context.getContentResolver().delete(uri, null, null);
return;
}