Loading android/app/src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java +20 −20 Original line number Diff line number Diff line Loading @@ -43,31 +43,31 @@ public class BluetoothOppHandoverReceiver extends BroadcastReceiver { if (D) Log.d(TAG, "No device attached to handover intent."); return; } String mimeType = intent.getType(); ArrayList<Uri> uris = new ArrayList<Uri>(); if (action.equals(Constants.ACTION_HANDOVER_SEND)) { String type = intent.getType(); Uri stream = (Uri)intent.getParcelableExtra(Intent.EXTRA_STREAM); if (stream != null && type != null) { // Save type/stream, will be used when adding transfer // session to DB. BluetoothOppManager.getInstance(context).saveSendingFileInfo(type, stream.toString(), true); } else { if (D) Log.d(TAG, "No mimeType or stream attached to handover request"); } if (stream != null) uris.add(stream); } else if (action.equals(Constants.ACTION_HANDOVER_SEND_MULTIPLE)) { ArrayList<Uri> uris = new ArrayList<Uri>(); String mimeType = intent.getType(); uris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM); if (mimeType != null && uris != null) { BluetoothOppManager.getInstance(context).saveSendingFileInfo(mimeType, uris, true); } if (mimeType != null && uris != null && !uris.isEmpty()) { final String finalType = mimeType; final ArrayList<Uri> finalUris = uris; Thread t = new Thread(new Runnable() { public void run() { BluetoothOppManager.getInstance(context).saveSendingFileInfo(finalType, finalUris, true); BluetoothOppManager.getInstance(context).startTransfer(device); } }); t.start(); } else { if (D) Log.d(TAG, "No mimeType or stream attached to handover request"); return; } } // we already know where to send to BluetoothOppManager.getInstance(context).startTransfer(device); } else if (action.equals(Constants.ACTION_WHITELIST_DEVICE)) { BluetoothDevice device = (BluetoothDevice)intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); Loading Loading
android/app/src/com/android/bluetooth/opp/BluetoothOppHandoverReceiver.java +20 −20 Original line number Diff line number Diff line Loading @@ -43,31 +43,31 @@ public class BluetoothOppHandoverReceiver extends BroadcastReceiver { if (D) Log.d(TAG, "No device attached to handover intent."); return; } String mimeType = intent.getType(); ArrayList<Uri> uris = new ArrayList<Uri>(); if (action.equals(Constants.ACTION_HANDOVER_SEND)) { String type = intent.getType(); Uri stream = (Uri)intent.getParcelableExtra(Intent.EXTRA_STREAM); if (stream != null && type != null) { // Save type/stream, will be used when adding transfer // session to DB. BluetoothOppManager.getInstance(context).saveSendingFileInfo(type, stream.toString(), true); } else { if (D) Log.d(TAG, "No mimeType or stream attached to handover request"); } if (stream != null) uris.add(stream); } else if (action.equals(Constants.ACTION_HANDOVER_SEND_MULTIPLE)) { ArrayList<Uri> uris = new ArrayList<Uri>(); String mimeType = intent.getType(); uris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM); if (mimeType != null && uris != null) { BluetoothOppManager.getInstance(context).saveSendingFileInfo(mimeType, uris, true); } if (mimeType != null && uris != null && !uris.isEmpty()) { final String finalType = mimeType; final ArrayList<Uri> finalUris = uris; Thread t = new Thread(new Runnable() { public void run() { BluetoothOppManager.getInstance(context).saveSendingFileInfo(finalType, finalUris, true); BluetoothOppManager.getInstance(context).startTransfer(device); } }); t.start(); } else { if (D) Log.d(TAG, "No mimeType or stream attached to handover request"); return; } } // we already know where to send to BluetoothOppManager.getInstance(context).startTransfer(device); } else if (action.equals(Constants.ACTION_WHITELIST_DEVICE)) { BluetoothDevice device = (BluetoothDevice)intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); Loading