Loading core/java/android/bluetooth/BluetoothDeviceProfileState.java +4 −4 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine public static final int TRANSITION_TO_STABLE = 102; public static final int CONNECT_OTHER_PROFILES = 103; private static final int AUTO_CONNECT_DELAY = 6000; // 6 secs private static final int CONNECT_OTHER_PROFILES_DELAY = 4000; // 4 secs private BondedDevice mBondedDevice = new BondedDevice(); private OutgoingHandsfree mOutgoingHandsfree = new OutgoingHandsfree(); Loading Loading @@ -152,7 +152,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine } else if (action.equals(BluetoothDevice.ACTION_ACL_CONNECTED)) { Message msg = new Message(); msg.what = AUTO_CONNECT_PROFILES; sendMessageDelayed(msg, AUTO_CONNECT_DELAY); sendMessage(msg); } else if (action.equals(BluetoothDevice.ACTION_ACL_DISCONNECTED)) { // This is technically not needed, but we can get stuck sometimes. // For example, if incoming A2DP fails, we are not informed by Bluez Loading Loading @@ -1019,7 +1019,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine Message msg = new Message(); msg.what = CONNECT_OTHER_PROFILES; msg.arg1 = CONNECT_A2DP_OUTGOING; sendMessageDelayed(msg, AUTO_CONNECT_DELAY); sendMessageDelayed(msg, CONNECT_OTHER_PROFILES_DELAY); } break; case CONNECT_A2DP_INCOMING: Loading @@ -1031,7 +1031,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine Message msg = new Message(); msg.what = CONNECT_OTHER_PROFILES; msg.arg1 = CONNECT_HFP_OUTGOING; sendMessageDelayed(msg, AUTO_CONNECT_DELAY); sendMessageDelayed(msg, CONNECT_OTHER_PROFILES_DELAY); } break; default: Loading core/java/android/server/BluetoothService.java +6 −2 Original line number Diff line number Diff line Loading @@ -420,6 +420,11 @@ public class BluetoothService extends IBluetooth.Stub { BluetoothDevice.UNBOND_REASON_AUTH_CANCELED); } // Stop the profile state machine for bonded devices. for (String address : mBondState.listInState(BluetoothDevice.BOND_BONDED)) { removeProfileState(address); } // update mode Intent intent = new Intent(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED); intent.putExtra(BluetoothAdapter.EXTRA_SCAN_MODE, BluetoothAdapter.SCAN_MODE_NONE); Loading Loading @@ -2714,10 +2719,9 @@ public class BluetoothService extends IBluetooth.Stub { for (String path : bonds) { String address = getAddressFromObjectPath(path); BluetoothDeviceProfileState state = addProfileState(address); // Allow 8 secs for SDP records to get registered. Message msg = new Message(); msg.what = BluetoothDeviceProfileState.AUTO_CONNECT_PROFILES; state.sendMessageDelayed(msg, 8000); state.sendMessage(msg); } } Loading Loading
core/java/android/bluetooth/BluetoothDeviceProfileState.java +4 −4 Original line number Diff line number Diff line Loading @@ -82,7 +82,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine public static final int TRANSITION_TO_STABLE = 102; public static final int CONNECT_OTHER_PROFILES = 103; private static final int AUTO_CONNECT_DELAY = 6000; // 6 secs private static final int CONNECT_OTHER_PROFILES_DELAY = 4000; // 4 secs private BondedDevice mBondedDevice = new BondedDevice(); private OutgoingHandsfree mOutgoingHandsfree = new OutgoingHandsfree(); Loading Loading @@ -152,7 +152,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine } else if (action.equals(BluetoothDevice.ACTION_ACL_CONNECTED)) { Message msg = new Message(); msg.what = AUTO_CONNECT_PROFILES; sendMessageDelayed(msg, AUTO_CONNECT_DELAY); sendMessage(msg); } else if (action.equals(BluetoothDevice.ACTION_ACL_DISCONNECTED)) { // This is technically not needed, but we can get stuck sometimes. // For example, if incoming A2DP fails, we are not informed by Bluez Loading Loading @@ -1019,7 +1019,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine Message msg = new Message(); msg.what = CONNECT_OTHER_PROFILES; msg.arg1 = CONNECT_A2DP_OUTGOING; sendMessageDelayed(msg, AUTO_CONNECT_DELAY); sendMessageDelayed(msg, CONNECT_OTHER_PROFILES_DELAY); } break; case CONNECT_A2DP_INCOMING: Loading @@ -1031,7 +1031,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine Message msg = new Message(); msg.what = CONNECT_OTHER_PROFILES; msg.arg1 = CONNECT_HFP_OUTGOING; sendMessageDelayed(msg, AUTO_CONNECT_DELAY); sendMessageDelayed(msg, CONNECT_OTHER_PROFILES_DELAY); } break; default: Loading
core/java/android/server/BluetoothService.java +6 −2 Original line number Diff line number Diff line Loading @@ -420,6 +420,11 @@ public class BluetoothService extends IBluetooth.Stub { BluetoothDevice.UNBOND_REASON_AUTH_CANCELED); } // Stop the profile state machine for bonded devices. for (String address : mBondState.listInState(BluetoothDevice.BOND_BONDED)) { removeProfileState(address); } // update mode Intent intent = new Intent(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED); intent.putExtra(BluetoothAdapter.EXTRA_SCAN_MODE, BluetoothAdapter.SCAN_MODE_NONE); Loading Loading @@ -2714,10 +2719,9 @@ public class BluetoothService extends IBluetooth.Stub { for (String path : bonds) { String address = getAddressFromObjectPath(path); BluetoothDeviceProfileState state = addProfileState(address); // Allow 8 secs for SDP records to get registered. Message msg = new Message(); msg.what = BluetoothDeviceProfileState.AUTO_CONNECT_PROFILES; state.sendMessageDelayed(msg, 8000); state.sendMessage(msg); } } Loading