diff --git a/src/com/android/settings/WirelessSettings.java b/src/com/android/settings/WirelessSettings.java
index 22417bb..ccce2a3 100644
--- a/src/com/android/settings/WirelessSettings.java
+++ b/src/com/android/settings/WirelessSettings.java
@@ -107,12 +107,12 @@
         Preference wifiPreference = findPreference(KEY_TOGGLE_WIFI);
         Preference btPreference = findPreference(KEY_TOGGLE_BLUETOOTH);
         Preference wifiSettings = findPreference(KEY_WIFI_SETTINGS);
+        Preference btSettings = findPreference(KEY_BT_SETTINGS);
         Preference vpnSettings = findPreference(KEY_VPN_SETTINGS);
 
         IBinder b = ServiceManager.getService(BluetoothAdapter.BLUETOOTH_SERVICE);
         if (b == null) {
             // Disable BT Settings if BT service is not available.
-            Preference btSettings = findPreference(KEY_BT_SETTINGS);
             btSettings.setEnabled(false);
         }
 
@@ -131,6 +131,13 @@
             wifiSettings.setDependency(airplanePreference.getKey());
             vpnSettings.setDependency(airplanePreference.getKey());
         }
+
+        // Manually set dependencies for Bluetooth when not toggleable.
+        if (toggleableRadios == null ||
+                !toggleableRadios.contains(Settings.System.RADIO_BLUETOOTH)) {
+            btPreference.setDependency(airplanePreference.getKey());
+            btSettings.setDependency(airplanePreference.getKey());
+        }
     }
 
     @Override
diff --git a/src/com/android/settings/bluetooth/BluetoothEnabler.java b/src/com/android/settings/bluetooth/BluetoothEnabler.java
index b872916..46793ce 100644
--- a/src/com/android/settings/bluetooth/BluetoothEnabler.java
+++ b/src/com/android/settings/bluetooth/BluetoothEnabler.java
@@ -16,6 +16,7 @@
 
 package com.android.settings.bluetooth;
 
+import com.android.settings.AirplaneModeEnabler;
 import com.android.settings.R;
 
 import android.bluetooth.BluetoothAdapter;
@@ -25,6 +26,7 @@
 import android.content.IntentFilter;
 import android.preference.Preference;
 import android.preference.CheckBoxPreference;
+import android.provider.Settings;
 import android.text.TextUtils;
 import android.util.Config;
 
@@ -116,14 +118,15 @@
                                            mOriginalSummary :
                                            null);
 
-            /*
-             * Don't ever disable the preference. Only enable here. Disablement
-             * is taken care of by the dependency code. If this is disabled
-             * here, it may not be re-enabled from the framework when dependency
-             * is met. http://b/issue?id=2053751
-             */
-            if (isEnabledByDependency()) {
+            final boolean hasDependency = !TextUtils.isEmpty(mCheckBoxPreference.getDependency());
+            final boolean bluetoothAllowed = isBluetoothAllowed(mContext);
+
+            // Avoid disabling when dependencies have been manually set,
+            // workaround for framework bug http://b/2053751
+            if (bluetoothAllowed) {
                 mCheckBoxPreference.setEnabled(true);
+            } else if (!hasDependency) {
+                mCheckBoxPreference.setEnabled(false);
             }
 
         } else if (state == BluetoothAdapter.STATE_TURNING_ON ||
@@ -139,22 +142,21 @@
         }
     }
 
-    private boolean isEnabledByDependency() {
-        Preference dep = getDependencyPreference();
-        if (dep == null) {
+    private static boolean isBluetoothAllowed(Context context) {
+        // allowed if we are not in airplane mode
+        if (!AirplaneModeEnabler.isAirplaneModeOn(context)) {
             return true;
         }
-
-        return !dep.shouldDisableDependents();
-    }
-
-    private Preference getDependencyPreference() {
-        String depKey = mCheckBoxPreference.getDependency();
-        if (TextUtils.isEmpty(depKey)) {
-            return null;
+        // allowed if bluetooth is not in AIRPLANE_MODE_RADIOS
+        String radios = Settings.System.getString(context.getContentResolver(),
+                Settings.System.AIRPLANE_MODE_RADIOS);
+        if (radios == null || !radios.contains(Settings.System.RADIO_BLUETOOTH)) {
+            return true;
         }
-
-        return mCheckBoxPreference.getPreferenceManager().findPreference(depKey);
+        // allowed if bluetooth is in AIRPLANE_MODE_TOGGLEABLE_RADIOS
+        radios = Settings.System.getString(context.getContentResolver(),
+                Settings.System.AIRPLANE_MODE_TOGGLEABLE_RADIOS);
+        return (radios != null && radios.contains(Settings.System.RADIO_BLUETOOTH));
     }
 
 }
diff --git a/src/com/android/settings/wifi/WifiEnabler.java b/src/com/android/settings/wifi/WifiEnabler.java
index 10a672b..b6c0fb5 100644
--- a/src/com/android/settings/wifi/WifiEnabler.java
+++ b/src/com/android/settings/wifi/WifiEnabler.java
@@ -122,9 +122,18 @@
             mWifiCheckBoxPref.setChecked(wifiState == WIFI_STATE_ENABLED);
             mWifiCheckBoxPref
                     .setSummary(wifiState == WIFI_STATE_DISABLED ? mOriginalSummary : null);
-            
-            mWifiCheckBoxPref.setEnabled(isWifiAllowed(mContext));
-            
+
+            final boolean hasDependency = !TextUtils.isEmpty(mWifiCheckBoxPref.getDependency());
+            final boolean wifiAllowed = isWifiAllowed(mContext);
+
+            // Avoid disabling when dependencies have been manually set,
+            // workaround for framework bug http://b/2053751
+            if (wifiAllowed) {
+                mWifiCheckBoxPref.setEnabled(true);
+            } else if (!hasDependency) {
+                mWifiCheckBoxPref.setEnabled(false);
+            }
+
         } else if (wifiState == WIFI_STATE_DISABLING || wifiState == WIFI_STATE_ENABLING) {
             mWifiCheckBoxPref.setSummary(wifiState == WIFI_STATE_ENABLING ? R.string.wifi_starting
                     : R.string.wifi_stopping);
