am 0cb3743e: b/2219381 Gray out Bluetooth Settings for the emulator

Merge commit '0cb3743e93aef81e7669f1e6c81184559e0f8154' into eclair-mr2

* commit '0cb3743e93aef81e7669f1e6c81184559e0f8154':
  b/2219381 Gray out Bluetooth Settings for the emulator
This commit is contained in:
Michael Chan
2009-10-29 19:34:49 -07:00
committed by Android Git Automerger
2 changed files with 15 additions and 4 deletions

View File

@@ -48,6 +48,7 @@
android:dependency="toggle_airplane" />
<PreferenceScreen
android:key="bt_settings"
android:title="@string/bluetooth_settings_title"
android:summary="@string/bluetooth_settings_summary"
android:dependency="toggle_airplane">

View File

@@ -16,21 +16,23 @@
package com.android.settings;
import com.android.settings.bluetooth.BluetoothEnabler;
import com.android.settings.wifi.WifiEnabler;
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.IBinder;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceScreen;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.provider.Settings;
import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.TelephonyProperties;
import com.android.settings.bluetooth.BluetoothEnabler;
import com.android.settings.wifi.WifiEnabler;
public class WirelessSettings extends PreferenceActivity {
@@ -38,6 +40,7 @@ public class WirelessSettings extends PreferenceActivity {
private static final String KEY_TOGGLE_BLUETOOTH = "toggle_bluetooth";
private static final String KEY_TOGGLE_WIFI = "toggle_wifi";
private static final String KEY_WIFI_SETTINGS = "wifi_settings";
private static final String KEY_BT_SETTINGS = "bt_settings";
private static final String KEY_VPN_SETTINGS = "vpn_settings";
public static final String EXIT_ECM_RESULT = "exit_ecm_result";
public static final int REQUEST_CODE_EXIT_ECM = 1;
@@ -106,6 +109,13 @@ public class WirelessSettings extends PreferenceActivity {
Preference wifiSettings = findPreference(KEY_WIFI_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);
}
mWifiEnabler = new WifiEnabler(
this, (WifiManager) getSystemService(WIFI_SERVICE),
(CheckBoxPreference) wifiPreference);