diff options
author | Nick Pelly <npelly@google.com> | 2012-03-01 12:31:05 -0800 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2012-03-02 10:28:15 -0800 |
commit | a2908a164eec02c34efc39db2e3ee0e38ebbfdb1 (patch) | |
tree | 999238ad0bdc5dee813286133035fab32d653fa6 /src/com/android/nfc/NfcDispatcher.java | |
parent | 51c2c8f3f8495c9521f15748495b2786cdf97744 (diff) | |
download | packages_apps_nfc-a2908a164eec02c34efc39db2e3ee0e38ebbfdb1.zip packages_apps_nfc-a2908a164eec02c34efc39db2e3ee0e38ebbfdb1.tar.gz packages_apps_nfc-a2908a164eec02c34efc39db2e3ee0e38ebbfdb1.tar.bz2 |
Implement NFC-BT handover for Bluetooth headsets, such as Nokia BH-505.
Touch once to turn BT on, pair, connect HFP and A2DP, and start the music.
Touch again to disconnect HFP and A2DP.
Change-Id: Icfe120606aae5e80b04cc4aba3b03331a1213676
TODO: enable Bluetooth without causing auto-connection to *other* devices
TOOD: disable Bluetooth when disconnecting if it was enabled for this device
TODO: il8n / UI review
TODO: check security issues around auto-on BT and auto-pair
Diffstat (limited to 'src/com/android/nfc/NfcDispatcher.java')
-rw-r--r-- | src/com/android/nfc/NfcDispatcher.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/nfc/NfcDispatcher.java b/src/com/android/nfc/NfcDispatcher.java index 2f442e6..1c7f912 100644 --- a/src/com/android/nfc/NfcDispatcher.java +++ b/src/com/android/nfc/NfcDispatcher.java @@ -17,6 +17,7 @@ package com.android.nfc; import com.android.nfc.RegisteredComponentCache.ComponentInfo; +import com.android.nfc.handover.HandoverManager; import android.app.Activity; import android.app.ActivityManagerNative; @@ -59,6 +60,7 @@ public class NfcDispatcher { final RegisteredComponentCache mTechListFilters; final PackageManager mPackageManager; final ContentResolver mContentResolver; + final HandoverManager mHandoverManager; // Locked on this PendingIntent mOverrideIntent; @@ -72,6 +74,7 @@ public class NfcDispatcher { NfcAdapter.ACTION_TECH_DISCOVERED, NfcAdapter.ACTION_TECH_DISCOVERED); mPackageManager = context.getPackageManager(); mContentResolver = context.getContentResolver(); + mHandoverManager = new HandoverManager(context); } public synchronized void setForegroundDispatch(PendingIntent intent, @@ -199,6 +202,11 @@ public class NfcDispatcher { return true; } + if (mHandoverManager.tryHandover(message)) { + if (DBG) Log.i(TAG, "matched BT HANDOVER"); + return true; + } + if (tryNdef(dispatch, message)) { return true; } |