OSDN Git Service

Enable Bluetooth sharing of downloaded files.
authorJake Hamby <jhamby@google.com>
Fri, 27 Jul 2012 21:38:32 +0000 (14:38 -0700)
committerJake Hamby <jhamby@google.com>
Fri, 14 Sep 2012 23:00:51 +0000 (16:00 -0700)
commitee52ddf33a0ce2cf89cc028136f60ae600c45de5
treed12ece24296ebc70d613b0880475f47e9119a4d4
parentf46f032adaec19a0d0c11b921fb356cbcd7aedbd
Enable Bluetooth sharing of downloaded files.

Change BT OPP to open the InputStreams of files to share in the
BluetoothOppLauncherActivity (or BluetoothOppHandoverReceiver
for NFC shares), while the process has grantUriPermission() on
the URI's to share.

InputStreams are saved inside the existing BluetoothOppSendFileInfo
objects, which no longer include the mDestination field because
this isn't known at the time the SendFileInfo object is now created
(before the user has chosen the destination BT device). These
objects are stored in a static ConcurrentHashMap in BluetoothOppUtility
and are removed when the file is closed (on success or failure).

If the user tries to share thousands of files in one batch, we may
not be able to open InputStreams for all of the files in the batch.
In this case, the open should fail gracefully.

Bug: 6808783
Change-Id: I3f3f86d2dc1a78a837aeb6a888f90b26434ba499
src/com/android/bluetooth/opp/BluetoothOppManager.java
src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java
src/com/android/bluetooth/opp/BluetoothOppSendFileInfo.java
src/com/android/bluetooth/opp/BluetoothOppService.java
src/com/android/bluetooth/opp/BluetoothOppShareInfo.java
src/com/android/bluetooth/opp/BluetoothOppTransfer.java
src/com/android/bluetooth/opp/BluetoothOppUtility.java