Lines Matching defs:state

411         // Stop the profile state machine for bonded devices.
481 * @param saveSetting If true, persist the new state of BT in settings
603 * It inits bond state and profile state before STATE_ON intent is broadcasted.
852 // Don't check state since we want to provide address, even if BT is off
858 // Don't check state since we want to provide name, even if BT is off
1004 // Check for bond state only if we are not performing auto
1106 BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
1107 if (state != null) {
1108 state.sendMessage(BluetoothDeviceProfileState.UNPAIR);
1116 // Unset the trusted device state and then unpair
1126 /*package*/ synchronized String[] listInState(int state) {
1127 return mBondState.listInState(state);
1138 /*package*/ synchronized boolean setBondState(String address, int state) {
1139 return setBondState(address, state, 0);
1142 /*package*/ synchronized boolean setBondState(String address, int state, int reason) {
1143 mBondState.setBondState(address.toUpperCase(), state, reason);
1162 * Sets the remote device trust state.
1180 * Gets the remote device trust state as boolean.
1184 * @return boolean to indicate trusted or untrusted state
1674 int state = intent.getIntExtra(Intent.EXTRA_DOCK_STATE,
1676 if (DBG) Log.v(TAG, "Received ACTION_DOCK_EVENT with State:" + state);
1677 if (state == Intent.EXTRA_DOCK_STATE_UNDOCKED) {
1774 pw.println("\n Headset profile state:" +
1776 pw.println("\n A2dp profile state:" +
1778 pw.println("\n HID profile state:" +
1780 pw.println("\n PAN profile state:" +
2030 // TODO: This needs to be converted to a state machine.
2092 int state,
2095 mBluetoothPanProfileHandler.handlePanDeviceStateChange(device, iface, state, role);
2100 int state, int role) {
2102 mBluetoothPanProfileHandler.handlePanDeviceStateChange(device, null, state, role);
2107 // This needs to be converted to state machine
2112 BluetoothDeviceProfileState state = mDeviceProfileState.get(device.getAddress());
2114 return mBluetoothInputProfileHandler.connectInputDevice(device, state);
2127 BluetoothDeviceProfileState state = mDeviceProfileState.get(device.getAddress());
2129 return mBluetoothInputProfileHandler.disconnectInputDevice(device, state);
2217 // TODO: All these need to be converted to a state machine.
2326 BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
2327 if (state == null) {
2332 state.sendMessage(msg);
2339 BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
2340 if (state != null) {
2343 msg.obj = state;
2353 BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
2354 if (state != null) {
2357 msg.obj = state;
2367 BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
2368 if (state != null) {
2371 msg.obj = state;
2381 BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
2382 if (state != null) {
2385 msg.obj = state;
2393 BluetoothDeviceProfileState state =
2395 mDeviceProfileState.put(address, state);
2396 state.start();
2397 return state;
2401 BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
2402 if (state == null) return;
2404 state.quit();
2428 BluetoothDeviceProfileState state = addProfileState(address, false);
2439 BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
2440 if (state != null) {
2443 state.sendMessage(msg);
2449 BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
2450 if (state != null) {
2457 state.sendMessageDelayed(msg,
2462 state.sendMessage(msg);
2470 BluetoothDeviceProfileState state = mDeviceProfileState.get(address);
2471 if (state != null) {
2478 state.sendMessageDelayed(msg,
2483 state.sendMessage(msg);
2516 Pair<Integer, Integer> state = mProfileConnectionState.get(profile);
2517 if (state == null) return BluetoothProfile.STATE_DISCONNECTED;
2519 return state.first;
2526 // is the state and the second element is the number of devices
2527 // in that state.
2533 // 1. If there is no record of profile and state - update
2534 // 2. If a new device's state is current hash state - increment
2535 // number of devices in the state.
2536 // 3. If a state change has happened to Connected or Connecting
2537 // (if current state is not connected), update.
2538 // 4. If numDevices is 1 and that device state is being updated, update
2539 // 5. If numDevices is > 1 and one of the devices is changing state,
2574 device, int profile, int state, int prevState) {
2578 if (!validateProfileConnectionState(state) ||
2580 // Previously, an invalid state was broadcast anyway,
2581 // with the invalid state converted to -1 in the intent.
2585 + "prevState " + prevState + " state " + state);
2589 updateProfileConnectionState(profile, state, prevState);
2591 if (updateCountersAndCheckForConnectionStateChange(state, prevState)) {
2592 mAdapterConnectionState = state;
2594 if (state == BluetoothProfile.STATE_DISCONNECTED) {
2601 convertToAdapterState(state));
2607 + prevState + " -> " + state);
2611 private boolean validateProfileConnectionState(int state) {
2612 return (state == BluetoothProfile.STATE_DISCONNECTED ||
2613 state == BluetoothProfile.STATE_CONNECTING ||
2614 state == BluetoothProfile.STATE_CONNECTED ||
2615 state == BluetoothProfile.STATE_DISCONNECTING);
2618 private int convertToAdapterState(int state) {
2619 switch (state) {
2633 private boolean updateCountersAndCheckForConnectionStateChange(int state, int prevState) {
2648 switch (state) {