From 487843886dc1c822ee568bb0d77e3f78356dfb87 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Thu, 30 Jul 2009 15:33:44 -0700 Subject: [PATCH] 2005382 Disable long press on Bluetooth device when BT is off 1930418 Grey BT device when BT is off --- .../android/settings/bluetooth/BluetoothDevicePreference.java | 4 ++-- src/com/android/settings/bluetooth/LocalBluetoothDevice.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java index 7053ff5fd74..a49ea7550c8 100644 --- a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java +++ b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java @@ -102,11 +102,11 @@ public class BluetoothDevicePreference extends Preference implements LocalBlueto @Override protected void onBindView(View view) { - super.onBindView(view); - // Disable this view if the bluetooth enable/disable preference view is off setDependency("bt_checkbox"); + super.onBindView(view); + ImageView btClass = (ImageView) view.findViewById(R.id.btClass); btClass.setImageResource(mLocalDevice.getBtClassDrawable()); btClass.setAlpha(isEnabled() ? 255 : sDimAlpha); diff --git a/src/com/android/settings/bluetooth/LocalBluetoothDevice.java b/src/com/android/settings/bluetooth/LocalBluetoothDevice.java index 862a9bd4751..cb2973f4b6f 100644 --- a/src/com/android/settings/bluetooth/LocalBluetoothDevice.java +++ b/src/com/android/settings/bluetooth/LocalBluetoothDevice.java @@ -690,7 +690,9 @@ public class LocalBluetoothDevice implements Comparable { public void onCreateContextMenu(ContextMenu menu) { // No context menu if it is busy (none of these items are applicable if busy) - if (isBusy()) return; + if (mLocalManager.getBluetoothState() != BluetoothDevice.BLUETOOTH_STATE_ON || isBusy()) { + return; + } int bondState = getBondState(); boolean isConnected = isConnected();