FileDocCategorySizeDatePackage
SettingsBtStatus.javaAPI DocAndroid 1.5 API3010Wed May 06 22:42:48 BST 2009com.android.settings.bluetooth

SettingsBtStatus

public class SettingsBtStatus extends Object
SettingsBtStatus is a helper class that contains constants for various status codes.

Fields Summary
private static final String
TAG
public static final int
CONNECTION_STATUS_UNKNOWN
public static final int
CONNECTION_STATUS_ACTIVE
public static final int
CONNECTION_STATUS_CONNECTED
Use {@link #isConnected} to check for the connected state
public static final int
CONNECTION_STATUS_CONNECTING
public static final int
CONNECTION_STATUS_DISCONNECTED
public static final int
CONNECTION_STATUS_DISCONNECTING
Constructors Summary
Methods Summary
public static final intgetConnectionStatusSummary(int connectionStatus)


          
        switch (connectionStatus) {
        case CONNECTION_STATUS_ACTIVE:
            return R.string.bluetooth_connected;
        case CONNECTION_STATUS_CONNECTED:
            return R.string.bluetooth_connected;
        case CONNECTION_STATUS_CONNECTING:
            return R.string.bluetooth_connecting;
        case CONNECTION_STATUS_DISCONNECTED:
            return R.string.bluetooth_disconnected;
        case CONNECTION_STATUS_DISCONNECTING:
            return R.string.bluetooth_disconnecting;
        case CONNECTION_STATUS_UNKNOWN:
            return R.string.bluetooth_unknown;
        default:
            return 0;
        }
    
public static final intgetPairingStatusSummary(int bondState)

        switch (bondState) {
        case BluetoothDevice.BOND_BONDED:
            return R.string.bluetooth_paired;
        case BluetoothDevice.BOND_BONDING:
            return R.string.bluetooth_pairing;
        case BluetoothDevice.BOND_NOT_BONDED:
            return R.string.bluetooth_not_connected;
        default:
            return 0;
        }
    
public static final booleanisConnectionStatusBusy(int connectionStatus)

        return connectionStatus == CONNECTION_STATUS_CONNECTING
                || connectionStatus == CONNECTION_STATUS_DISCONNECTING;
    
public static final booleanisConnectionStatusConnected(int connectionStatus)

        return connectionStatus == CONNECTION_STATUS_ACTIVE
                || connectionStatus == CONNECTION_STATUS_CONNECTED;