diff --git a/src/com/android/bluetooth/opp/BluetoothOppManager.java b/src/com/android/bluetooth/opp/BluetoothOppManager.java
index c996690..dd8efe0 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppManager.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppManager.java
@@ -246,12 +246,15 @@
         if (V) Log.v(TAG, "Application data stored to SharedPreference! ");
     }
 
-    public void saveSendingFileInfo(String mimeType, String uri, boolean isHandover) {
+    public void saveSendingFileInfo(String mimeType, String uriString, boolean isHandover) {
         synchronized (BluetoothOppManager.this) {
             mMultipleFlag = false;
             mMimeTypeOfSendingFile = mimeType;
-            mUriOfSendingFile = uri;
+            mUriOfSendingFile = uriString;
             mIsHandoverInitiated = isHandover;
+            Uri uri = Uri.parse(uriString);
+            BluetoothOppUtility.putSendFileInfo(uri,
+                    BluetoothOppSendFileInfo.generateFileInfo(mContext, uri, mimeType));
             storeApplicationData();
         }
     }
@@ -262,6 +265,10 @@
             mMimeTypeOfSendingFiles = mimeType;
             mUrisOfSendingFiles = uris;
             mIsHandoverInitiated = isHandover;
+            for (Uri uri : uris) {
+                BluetoothOppUtility.putSendFileInfo(uri,
+                        BluetoothOppSendFileInfo.generateFileInfo(mContext, uri, mimeType));
+            }
             storeApplicationData();
         }
     }
diff --git a/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java b/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java
index f234203..dce7fa3 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java
@@ -305,8 +305,7 @@
         private BluetoothOppSendFileInfo processShareInfo() {
             if (V) Log.v(TAG, "Client thread processShareInfo() " + mInfo.mId);
 
-            BluetoothOppSendFileInfo fileInfo = BluetoothOppSendFileInfo.generateFileInfo(
-                    mContext1, mInfo.mUri, mInfo.mMimetype, mInfo.mDestination);
+            BluetoothOppSendFileInfo fileInfo = BluetoothOppUtility.getSendFileInfo(mInfo.mUri);
             if (fileInfo.mFileName == null || fileInfo.mLength == 0) {
                 if (V) Log.v(TAG, "BluetoothOppSendFileInfo get invalid file");
                     Constants.updateShareStatus(mContext1, mInfo.mId, fileInfo.mStatus);
@@ -343,7 +342,7 @@
             request.setHeader(HeaderSet.NAME, fileInfo.mFileName);
             request.setHeader(HeaderSet.TYPE, fileInfo.mMimetype);
 
-            applyRemoteDeviceQuirks(request, fileInfo);
+            applyRemoteDeviceQuirks(request, mInfo.mDestination, fileInfo.mFileName);
 
             Constants.updateShareStatus(mContext1, mInfo.mId, BluetoothShare.STATUS_RUNNING);
 
@@ -500,7 +499,8 @@
                 handleSendException(e.toString());
             } finally {
                 try {
-                    fileInfo.mInputStream.close();
+                    // Close InputStream and remove SendFileInfo from map
+                    BluetoothOppUtility.closeSendFileInfo(mInfo.mUri);
                     if (!error) {
                         responseCode = putOperation.getResponseCode();
                         if (responseCode != -1) {
@@ -566,8 +566,7 @@
         }
     }
 
-    public static void applyRemoteDeviceQuirks(HeaderSet request, BluetoothOppSendFileInfo info) {
-        String address = info.mDestAddr;
+    public static void applyRemoteDeviceQuirks(HeaderSet request, String address, String filename) {
         if (address == null) {
             return;
         }
@@ -576,8 +575,6 @@
             // Rejects filenames with more than one '.'. Rename to '_'.
             // for example: 'a.b.jpg' -> 'a_b.jpg'
             //              'abc.jpg' NOT CHANGED
-            String filename = info.mFileName;
-
             char[] c = filename.toCharArray();
             boolean firstDot = true;
             boolean modified = false;
diff --git a/src/com/android/bluetooth/opp/BluetoothOppSendFileInfo.java b/src/com/android/bluetooth/opp/BluetoothOppSendFileInfo.java
index ec879f0..81c3c92 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppSendFileInfo.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppSendFileInfo.java
@@ -32,19 +32,18 @@
 
 package com.android.bluetooth.opp;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-
-import android.util.Log;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.res.AssetFileDescriptor;
 import android.database.Cursor;
 import android.net.Uri;
-import android.os.ParcelFileDescriptor;
 import android.provider.OpenableColumns;
+import android.util.Log;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
 
 /**
  * This class stores information about a single sending file It will only be
@@ -57,6 +56,10 @@
 
     private static final boolean V = Constants.VERBOSE;
 
+    /** Reusable SendFileInfo for error status. */
+    static final BluetoothOppSendFileInfo SEND_FILE_INFO_ERROR = new BluetoothOppSendFileInfo(
+            null, null, 0, null, BluetoothShare.STATUS_FILE_ERROR);
+
     /** readable media file name */
     public final String mFileName;
 
@@ -72,46 +75,40 @@
 
     public final long mLength;
 
-    public final String mDestAddr;
-
     /** for media file */
     public BluetoothOppSendFileInfo(String fileName, String type, long length,
-            FileInputStream inputStream, int status, String dest) {
+            FileInputStream inputStream, int status) {
         mFileName = fileName;
         mMimetype = type;
         mLength = length;
         mInputStream = inputStream;
         mStatus = status;
-        mDestAddr = dest;
         mData = null;
     }
 
     /** for vCard, or later for vCal, vNote. Not used currently */
-    public BluetoothOppSendFileInfo(String data, String type, long length, int status,
-            String dest) {
+    public BluetoothOppSendFileInfo(String data, String type, long length, int status) {
         mFileName = null;
         mInputStream = null;
         mData = data;
         mMimetype = type;
         mLength = length;
         mStatus = status;
-        mDestAddr = dest;
     }
 
-    public static BluetoothOppSendFileInfo generateFileInfo(Context context, String uri,
-            String type, String dest) {
+    public static BluetoothOppSendFileInfo generateFileInfo(Context context, Uri uri,
+            String type) {
         ContentResolver contentResolver = context.getContentResolver();
-        Uri u = Uri.parse(uri);
-        String scheme = u.getScheme();
+        String scheme = uri.getScheme();
         String fileName = null;
-        String contentType = null;
+        String contentType;
         long length = 0;
         // Support all Uri with "content" scheme
         // This will allow more 3rd party applications to share files via
         // bluetooth
-        if (scheme.equals("content")) {
-            contentType = contentResolver.getType(u);
-            Cursor metadataCursor = contentResolver.query(u, new String[] {
+        if ("content".equals(scheme)) {
+            contentType = contentResolver.getType(uri);
+            Cursor metadataCursor = contentResolver.query(uri, new String[] {
                     OpenableColumns.DISPLAY_NAME, OpenableColumns.SIZE
             }, null, null, null);
             if (metadataCursor != null) {
@@ -125,25 +122,23 @@
                     metadataCursor.close();
                 }
             }
-        } else if (scheme.equals("file")) {
-            fileName = u.getLastPathSegment();
+        } else if ("file".equals(scheme)) {
+            fileName = uri.getLastPathSegment();
             contentType = type;
-            File f = new File(u.getPath());
+            File f = new File(uri.getPath());
             length = f.length();
         } else {
             // currently don't accept other scheme
-            return new BluetoothOppSendFileInfo(null, null, 0, null,
-                    BluetoothShare.STATUS_FILE_ERROR, dest);
+            return SEND_FILE_INFO_ERROR;
         }
         FileInputStream is = null;
         if (scheme.equals("content")) {
-            AssetFileDescriptor fd = null;
             try {
                 // We've found that content providers don't always have the
                 // right size in _OpenableColumns.SIZE
                 // As a second source of getting the correct file length,
                 // get a file descriptor and get the stat length
-                fd = contentResolver.openAssetFileDescriptor(u, "r");
+                AssetFileDescriptor fd = contentResolver.openAssetFileDescriptor(uri, "r");
                 long statLength = fd.getLength();
                 if (length != statLength && statLength > 0) {
                     Log.e(TAG, "Content provider length is wrong (" + Long.toString(length) +
@@ -154,7 +149,7 @@
                     // This creates an auto-closing input-stream, so
                     // the file descriptor will be closed whenever the InputStream
                     // is closed.
-                    is = (FileInputStream)fd.createInputStream();
+                    is = fd.createInputStream();
                 } catch (IOException e) {
                     try {
                         fd.close();
@@ -168,10 +163,9 @@
         }
         if (is == null) {
             try {
-                is = (FileInputStream)contentResolver.openInputStream(u);
+                is = (FileInputStream) contentResolver.openInputStream(uri);
             } catch (FileNotFoundException e) {
-                return new BluetoothOppSendFileInfo(null, null, 0, null,
-                        BluetoothShare.STATUS_FILE_ERROR, dest);
+                return SEND_FILE_INFO_ERROR;
             }
         }
         // If we can not get file length from content provider, we can try to
@@ -182,11 +176,10 @@
                 if (V) Log.v(TAG, "file length is " + length);
             } catch (IOException e) {
                 Log.e(TAG, "Read stream exception: ", e);
-                return new BluetoothOppSendFileInfo(null, null, 0, null,
-                        BluetoothShare.STATUS_FILE_ERROR, dest);
+                return SEND_FILE_INFO_ERROR;
             }
         }
 
-        return new BluetoothOppSendFileInfo(fileName, contentType, length, is, 0, dest);
+        return new BluetoothOppSendFileInfo(fileName, contentType, length, is, 0);
     }
 }
diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java
index 5a30433..9020006 100755
--- a/src/com/android/bluetooth/opp/BluetoothOppService.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppService.java
@@ -543,9 +543,18 @@
     }
 
     private void insertShare(Cursor cursor, int arrayPos) {
+        String uriString = cursor.getString(cursor.getColumnIndexOrThrow(BluetoothShare.URI));
+        Uri uri;
+        if (uriString != null) {
+            uri = Uri.parse(uriString);
+            Log.d(TAG, "insertShare parsed URI: " + uri);
+        } else {
+            uri = null;
+            Log.e(TAG, "insertShare found null URI at cursor!");
+        }
         BluetoothOppShareInfo info = new BluetoothOppShareInfo(
                 cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare._ID)),
-                cursor.getString(cursor.getColumnIndexOrThrow(BluetoothShare.URI)),
+                uri,
                 cursor.getString(cursor.getColumnIndexOrThrow(BluetoothShare.FILENAME_HINT)),
                 cursor.getString(cursor.getColumnIndexOrThrow(BluetoothShare._DATA)),
                 cursor.getString(cursor.getColumnIndexOrThrow(BluetoothShare.MIMETYPE)),
@@ -597,23 +606,12 @@
         if (info.isReadyToStart()) {
             if (info.mDirection == BluetoothShare.DIRECTION_OUTBOUND) {
                 /* check if the file exists */
-                InputStream i;
-                try {
-                    i = getContentResolver().openInputStream(Uri.parse(info.mUri));
-                } catch (FileNotFoundException e) {
+                BluetoothOppSendFileInfo sendFileInfo = BluetoothOppUtility.getSendFileInfo(
+                        info.mUri);
+                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);
-                    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);
+                    BluetoothOppUtility.closeSendFileInfo(info.mUri);
                     return;
                 }
             }
@@ -678,7 +676,12 @@
         int statusColumn = cursor.getColumnIndexOrThrow(BluetoothShare.STATUS);
 
         info.mId = cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare._ID));
-        info.mUri = stringFromCursor(info.mUri, cursor, BluetoothShare.URI);
+        if (info.mUri != null) {
+            info.mUri = Uri.parse(stringFromCursor(info.mUri.toString(), cursor,
+                    BluetoothShare.URI));
+        } else {
+            Log.d(TAG, "updateShare() called for ID " + info.mId + " with null URI");
+        }
         info.mHint = stringFromCursor(info.mHint, cursor, BluetoothShare.FILENAME_HINT);
         info.mFilename = stringFromCursor(info.mFilename, cursor, BluetoothShare._DATA);
         info.mMimetype = stringFromCursor(info.mMimetype, cursor, BluetoothShare.MIMETYPE);
diff --git a/src/com/android/bluetooth/opp/BluetoothOppShareInfo.java b/src/com/android/bluetooth/opp/BluetoothOppShareInfo.java
index da57bd2..32f6b3c 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppShareInfo.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppShareInfo.java
@@ -32,6 +32,8 @@
 
 package com.android.bluetooth.opp;
 
+import android.net.Uri;
+
 /**
  * This class stores information about a single OBEX share, e.g. one object
  * send/receive to a destination address.
@@ -40,7 +42,7 @@
 
     public int mId;
 
-    public String mUri;
+    public Uri mUri;
 
     public String mHint;
 
@@ -66,7 +68,7 @@
 
     public boolean mMediaScanned;
 
-    public BluetoothOppShareInfo(int id, String uri, String hint, String filename, String mimetype,
+    public BluetoothOppShareInfo(int id, Uri uri, String hint, String filename, String mimetype,
             int direction, String destination, int visibility, int confirm, int status,
             int totalBytes, int currentBytes, int timestamp, boolean mediaScanned) {
         mId = id;
diff --git a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
index 44d9bb6..2be679c 100755
--- a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
@@ -315,9 +315,9 @@
                 updateValues.put(BluetoothShare.STATUS, info.mStatus);
                 /* Update un-processed outbound transfer to show some info */
                 if (info.mDirection == BluetoothShare.DIRECTION_OUTBOUND) {
-                    BluetoothOppSendFileInfo fileInfo = null;
-                    fileInfo = BluetoothOppSendFileInfo.generateFileInfo(mContext, info.mUri,
-                            info.mMimetype, info.mDestination);
+                    BluetoothOppSendFileInfo fileInfo
+                            = BluetoothOppUtility.getSendFileInfo(info.mUri);
+                    BluetoothOppUtility.closeSendFileInfo(info.mUri);
                     if (fileInfo.mFileName != null) {
                         updateValues.put(BluetoothShare.FILENAME_HINT, fileInfo.mFileName);
                         updateValues.put(BluetoothShare.TOTAL_BYTES, fileInfo.mLength);
diff --git a/src/com/android/bluetooth/opp/BluetoothOppUtility.java b/src/com/android/bluetooth/opp/BluetoothOppUtility.java
index df26bd2..7e03281 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppUtility.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppUtility.java
@@ -49,8 +49,10 @@
 import android.util.Log;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * This class has some utilities for Opp application;
@@ -60,6 +62,9 @@
     private static final boolean D = Constants.DEBUG;
     private static final boolean V = Constants.VERBOSE;
 
+    private static final ConcurrentHashMap<Uri, BluetoothOppSendFileInfo> sSendFileMap
+            = new ConcurrentHashMap<Uri, BluetoothOppSendFileInfo>();
+
     public static BluetoothOppTransferInfo queryRecord(Context context, Uri uri) {
         BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
         BluetoothOppTransferInfo info = new BluetoothOppTransferInfo();
@@ -303,4 +308,25 @@
                 transInfo.mDeviceName);
     }
 
+    static void putSendFileInfo(Uri uri, BluetoothOppSendFileInfo sendFileInfo) {
+        if (D) Log.d(TAG, "putSendFileInfo: uri=" + uri + " sendFileInfo=" + sendFileInfo);
+        sSendFileMap.put(uri, sendFileInfo);
+    }
+
+    static BluetoothOppSendFileInfo getSendFileInfo(Uri uri) {
+        if (D) Log.d(TAG, "getSendFileInfo: uri=" + uri);
+        BluetoothOppSendFileInfo info = sSendFileMap.get(uri);
+        return (info != null) ? info : BluetoothOppSendFileInfo.SEND_FILE_INFO_ERROR;
+    }
+
+    static void closeSendFileInfo(Uri uri) {
+        if (D) Log.d(TAG, "closeSendFileInfo: uri=" + uri);
+        BluetoothOppSendFileInfo info = sSendFileMap.remove(uri);
+        if (info != null) {
+            try {
+                info.mInputStream.close();
+            } catch (IOException ignored) {
+            }
+        }
+    }
 }
