From 893be9cc34c37cba64856c8034f39dfbda05a459 Mon Sep 17 00:00:00 2001 From: PauloftheWest Date: Sun, 24 Aug 2014 14:04:18 -0700 Subject: [PATCH] Tapping a connected Bluetooth device now presents its settings dialog. Bug: 14184769 Change-Id: I1de3110dd7460e0329dbe6df99abf3451d3041cc --- src/com/android/settings/bluetooth/BluetoothDevicePreference.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java index eca0ccafb4..4b16ff4907 100644 --- a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java +++ b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java @@ -56,6 +56,8 @@ public final class BluetoothDevicePreference extends Preference implements private AlertDialog mDisconnectDialog; + private View mView; + public BluetoothDevicePreference(Context context, CachedBluetoothDevice cachedDevice) { super(context); @@ -140,6 +142,7 @@ public final class BluetoothDevicePreference extends Preference implements } } + mView = view; super.onBindView(view); } @@ -179,7 +182,10 @@ public final class BluetoothDevicePreference extends Preference implements int bondState = mCachedDevice.getBondState(); if (mCachedDevice.isConnected()) { - askDisconnect(); + if (mOnSettingsClickListener != null) { + mView.setTag(mCachedDevice); + mOnSettingsClickListener.onClick(mView); + } } else if (bondState == BluetoothDevice.BOND_BONDED) { mCachedDevice.connect(true); } else if (bondState == BluetoothDevice.BOND_NONE) { -- 2.11.0