Skip to content

Commit 0d9a41e

Browse files
Matthew XieAndroid (Google) Code Review
authored andcommitted
Merge "Broadcast turning on/off intent as early as possible when switch on/off BT" into ics-mr1
2 parents 0c0120e + a6ba6fd commit 0d9a41e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/java/android/server/BluetoothAdapterStateMachine.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ public boolean processMessage(Message message) {
175175
switch(message.what) {
176176
case USER_TURN_ON:
177177
// starts turning on BT module, broadcast this out
178-
transitionTo(mWarmUp);
179178
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
179+
transitionTo(mWarmUp);
180180
if (prepareBluetooth()) {
181181
// this is user request, save the setting
182182
if ((Boolean) message.obj) {
@@ -198,8 +198,8 @@ public boolean processMessage(Message message) {
198198
case AIRPLANE_MODE_OFF:
199199
if (getBluetoothPersistedSetting()) {
200200
// starts turning on BT module, broadcast this out
201-
transitionTo(mWarmUp);
202201
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
202+
transitionTo(mWarmUp);
203203
if (prepareBluetooth()) {
204204
// We will continue turn the BT on all the way to the BluetoothOn state
205205
deferMessage(obtainMessage(TURN_ON_CONTINUE));
@@ -355,9 +355,9 @@ public boolean processMessage(Message message) {
355355
// let it fall to TURN_ON_CONTINUE:
356356
//$FALL-THROUGH$
357357
case TURN_ON_CONTINUE:
358+
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
358359
mBluetoothService.switchConnectable(true);
359360
transitionTo(mSwitching);
360-
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
361361
break;
362362
case AIRPLANE_MODE_ON:
363363
case TURN_COLD:
@@ -367,9 +367,9 @@ public boolean processMessage(Message message) {
367367
break;
368368
case AIRPLANE_MODE_OFF:
369369
if (getBluetoothPersistedSetting()) {
370+
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
370371
transitionTo(mSwitching);
371372
mBluetoothService.switchConnectable(true);
372-
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
373373
}
374374
break;
375375
case PER_PROCESS_TURN_ON:
@@ -515,8 +515,8 @@ public boolean processMessage(Message message) {
515515
}
516516
//$FALL-THROUGH$ to AIRPLANE_MODE_ON
517517
case AIRPLANE_MODE_ON:
518-
transitionTo(mSwitching);
519518
broadcastState(BluetoothAdapter.STATE_TURNING_OFF);
519+
transitionTo(mSwitching);
520520
if (mBluetoothService.getAdapterConnectionState() !=
521521
BluetoothAdapter.STATE_DISCONNECTED) {
522522
mBluetoothService.disconnectDevices();

0 commit comments

Comments
 (0)