OSDN Git Service

Don't MediaScan files received through handover.
authorMartijn Coenen <maco@google.com>
Tue, 15 May 2012 21:36:06 +0000 (14:36 -0700)
committerMartijn Coenen <maco@google.com>
Tue, 15 May 2012 21:36:06 +0000 (14:36 -0700)
Handover providers such as NFC may move the file in the filesystem
(out of /bluetooth), hence it's better not to scan them here.

Change-Id: Ic374c5ae880cb65e2d8a9ce615115b51fdc29353

src/com/android/bluetooth/opp/BluetoothOppService.java

index 4f68741..c348e33 100644 (file)
@@ -865,7 +865,8 @@ public class BluetoothOppService extends Service {
     private boolean shouldScanFile(int arrayPos) {
         BluetoothOppShareInfo info = mShares.get(arrayPos);
         return BluetoothShare.isStatusSuccess(info.mStatus)
-                && info.mDirection == BluetoothShare.DIRECTION_INBOUND && !info.mMediaScanned;
+                && info.mDirection == BluetoothShare.DIRECTION_INBOUND && !info.mMediaScanned &&
+                info.mConfirm != BluetoothShare.USER_CONFIRMATION_HANDOVER_CONFIRMED;
     }
 
     // Run in a background thread at boot.