diff options
| author | Jaikumar Ganesh <jaikumar@google.com> | 2011-08-01 19:11:18 -0700 |
|---|---|---|
| committer | Jaikumar Ganesh <jaikumar@google.com> | 2011-08-02 10:31:26 -0700 |
| commit | bbd86750570ff75e428b3810dc2e65db558c14b2 (patch) | |
| tree | c7ceea1075ae0c87cf01fc8e8b27878b6a9060cd /core/java/android/bluetooth | |
| parent | 9a6c7383b3d3000b33c5835851331edcacc47811 (diff) | |
| download | frameworks_base-bbd86750570ff75e428b3810dc2e65db558c14b2.zip frameworks_base-bbd86750570ff75e428b3810dc2e65db558c14b2.tar.gz frameworks_base-bbd86750570ff75e428b3810dc2e65db558c14b2.tar.bz2 | |
Fix tethering using BT.
1. Since Input device runs in Bluetooth Service, avoid the proxy call.
2. Accept or reject incoming tethering connections.
This broke because of incoming connection request change for phonebook, HID,
A2DP.
Change-Id: Ia8c537bb79e4dbc66cfb6b23dcad4f99dbf950b3
Diffstat (limited to 'core/java/android/bluetooth')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothDeviceProfileState.java | 4 | ||||
| -rw-r--r-- | core/java/android/bluetooth/BluetoothInputDevice.java | 22 | ||||
| -rw-r--r-- | core/java/android/bluetooth/IBluetooth.aidl | 2 |
3 files changed, 3 insertions, 25 deletions
diff --git a/core/java/android/bluetooth/BluetoothDeviceProfileState.java b/core/java/android/bluetooth/BluetoothDeviceProfileState.java index 095cd11..316c474 100644 --- a/core/java/android/bluetooth/BluetoothDeviceProfileState.java +++ b/core/java/android/bluetooth/BluetoothDeviceProfileState.java @@ -1048,12 +1048,12 @@ public final class BluetoothDeviceProfileState extends StateMachine { break; case CONNECT_HID_INCOMING: if (!accept) { - ret = mService.allowIncomingHidConnect(mDevice, false); + ret = mService.allowIncomingProfileConnect(mDevice, false); sendMessage(TRANSITION_TO_STABLE); updateIncomingAllowedTimer(); } else { writeTimerValue(0); - ret = mService.allowIncomingHidConnect(mDevice, true); + ret = mService.allowIncomingProfileConnect(mDevice, true); } break; default: diff --git a/core/java/android/bluetooth/BluetoothInputDevice.java b/core/java/android/bluetooth/BluetoothInputDevice.java index f6757d9..282b70a 100644 --- a/core/java/android/bluetooth/BluetoothInputDevice.java +++ b/core/java/android/bluetooth/BluetoothInputDevice.java @@ -308,28 +308,6 @@ public final class BluetoothInputDevice implements BluetoothProfile { return BluetoothProfile.PRIORITY_OFF; } - /** - * Allow or disallow incoming connection - * @param device Input device - * @param allow true / false - * @return Success or Failure of the operation - * @hide - */ - public boolean allowIncomingConnect(BluetoothDevice device, boolean allow) { - if (DBG) log("allowIncomingConnect(" + device + ", " + allow + ")"); - - if (mService == null || !isEnabled() || !isValidDevice(device)) { - return false; - } - try { - mService.allowIncomingHidConnect(device, allow); - } catch (RemoteException e) { - Log.e(TAG, "Stack:" + Log.getStackTraceString(new Throwable())); - return false; - } - return true; - } - private boolean isEnabled() { if (mAdapter.getState() == BluetoothAdapter.STATE_ON) return true; return false; diff --git a/core/java/android/bluetooth/IBluetooth.aidl b/core/java/android/bluetooth/IBluetooth.aidl index ddede9c..48dfed8 100644 --- a/core/java/android/bluetooth/IBluetooth.aidl +++ b/core/java/android/bluetooth/IBluetooth.aidl @@ -85,6 +85,7 @@ interface IBluetooth int addRfcommServiceRecord(in String serviceName, in ParcelUuid uuid, int channel, IBinder b); void removeServiceRecord(int handle); + boolean allowIncomingProfileConnect(in BluetoothDevice device, boolean value); boolean connectHeadset(String address); boolean disconnectHeadset(String address); @@ -98,7 +99,6 @@ interface IBluetooth int getInputDeviceConnectionState(in BluetoothDevice device); boolean setInputDevicePriority(in BluetoothDevice device, int priority); int getInputDevicePriority(in BluetoothDevice device); - boolean allowIncomingHidConnect(in BluetoothDevice device, boolean value); boolean isTetheringOn(); void setBluetoothTethering(boolean value); |
