Skip to content

Commit 2d789e5

Browse files
author
Matthew Xie
committed
Move broadcastState STATE_TURNING_ON before persistSwitchSetting
CTS test revealed that persistSwitchSetting could take more than 1 second. STATE_TURNING_ON intent missed the test timing. We move the broadcast before persistSwitchSetting bug 5740715 Change-Id: I54a0a0afc8d1c4fc28f84e6122809af2f1456ca7
1 parent 4b3227d commit 2d789e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/java/android/server/BluetoothAdapterStateMachine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,13 +349,13 @@ public boolean processMessage(Message message) {
349349
boolean retValue = HANDLED;
350350
switch(message.what) {
351351
case USER_TURN_ON:
352+
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
352353
if ((Boolean) message.obj) {
353354
persistSwitchSetting(true);
354355
}
355356
// let it fall to TURN_ON_CONTINUE:
356357
//$FALL-THROUGH$
357358
case TURN_ON_CONTINUE:
358-
broadcastState(BluetoothAdapter.STATE_TURNING_ON);
359359
mBluetoothService.switchConnectable(true);
360360
transitionTo(mSwitching);
361361
break;

0 commit comments

Comments
 (0)