修改文件:
packages/apps/Bluetooth/src/com/android/bluetooth/opp/BluetoothOppReceiveFileInfo.java
相关代码片段:
public static BluetoothOppReceiveFileInfo generateFileInfo(Context context, int id) {
ContentResolver contentResolver = context.getContentResolver();
Uri contentUri = Uri.parse(BluetoothShare.CONTENT_URI + "/" + id);
String filename = null, hint = null, mimeType = null;
long length = 0;
Cursor metadataCursor = null;
try {
metadataCursor = contentResolver.query(contentUri, new String[] {
BluetoothShare.FILENAME_HINT, BluetoothShare.TOTAL_BYTES, BluetoothShare.MIMETYPE
}, null, null, null);
} catch (SQLiteException e) {
if (metadataCursor != null) {
metadataCursor.close();
}
metadataCursor = null;
Log.e(Constants.TAG, "generateFileInfo: " + e);
} catch (CursorWindowAllocationException e) {
metadataCursor = null;
Log.e(Constants.TAG, "generateFileInfo: " + e);
}
if (metadataCursor != null) {
try {
if (metadataCursor.moveToFirst()) {
hint = metadataCursor.getString(0);
length = metadataCursor.getLong(1);
mimeType = metadataCursor.getString(2);
}
} finally {
metadataCursor.clo