am 0d9a41e7: Merge "Broadcast turning on/off intent as early as possible when switch on/off BT" into ics-mr1
* commit '0d9a41e74c81e8297ee439473c301a50da20cf0b': Broadcast turning on/off intent as early as possible when switch on/off BT
This commit is contained in:
@@ -175,8 +175,8 @@ final class BluetoothAdapterStateMachine extends StateMachine {
|
||||
switch(message.what) {
|
||||
case USER_TURN_ON:
|
||||
// starts turning on BT module, broadcast this out
|
||||
transitionTo(mWarmUp);
|
||||
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
|
||||
transitionTo(mWarmUp);
|
||||
if (prepareBluetooth()) {
|
||||
// this is user request, save the setting
|
||||
if ((Boolean) message.obj) {
|
||||
@@ -198,8 +198,8 @@ final class BluetoothAdapterStateMachine extends StateMachine {
|
||||
case AIRPLANE_MODE_OFF:
|
||||
if (getBluetoothPersistedSetting()) {
|
||||
// starts turning on BT module, broadcast this out
|
||||
transitionTo(mWarmUp);
|
||||
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
|
||||
transitionTo(mWarmUp);
|
||||
if (prepareBluetooth()) {
|
||||
// We will continue turn the BT on all the way to the BluetoothOn state
|
||||
deferMessage(obtainMessage(TURN_ON_CONTINUE));
|
||||
@@ -355,9 +355,9 @@ final class BluetoothAdapterStateMachine extends StateMachine {
|
||||
// let it fall to TURN_ON_CONTINUE:
|
||||
//$FALL-THROUGH$
|
||||
case TURN_ON_CONTINUE:
|
||||
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
|
||||
mBluetoothService.switchConnectable(true);
|
||||
transitionTo(mSwitching);
|
||||
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
|
||||
break;
|
||||
case AIRPLANE_MODE_ON:
|
||||
case TURN_COLD:
|
||||
@@ -367,9 +367,9 @@ final class BluetoothAdapterStateMachine extends StateMachine {
|
||||
break;
|
||||
case AIRPLANE_MODE_OFF:
|
||||
if (getBluetoothPersistedSetting()) {
|
||||
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
|
||||
transitionTo(mSwitching);
|
||||
mBluetoothService.switchConnectable(true);
|
||||
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
|
||||
}
|
||||
break;
|
||||
case PER_PROCESS_TURN_ON:
|
||||
@@ -515,8 +515,8 @@ final class BluetoothAdapterStateMachine extends StateMachine {
|
||||
}
|
||||
//$FALL-THROUGH$ to AIRPLANE_MODE_ON
|
||||
case AIRPLANE_MODE_ON:
|
||||
transitionTo(mSwitching);
|
||||
broadcastState(BluetoothAdapter.STATE_TURNING_OFF);
|
||||
transitionTo(mSwitching);
|
||||
if (mBluetoothService.getAdapterConnectionState() !=
|
||||
BluetoothAdapter.STATE_DISCONNECTED) {
|
||||
mBluetoothService.disconnectDevices();
|
||||
|
||||
Reference in New Issue
Block a user