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
diff --git a/core/java/android/server/BluetoothAdapterStateMachine.java b/core/java/android/server/BluetoothAdapterStateMachine.java
index f3f4174..8ec79e2 100644
--- a/core/java/android/server/BluetoothAdapterStateMachine.java
+++ b/core/java/android/server/BluetoothAdapterStateMachine.java
@@ -349,13 +349,13 @@
boolean retValue = HANDLED;
switch(message.what) {
case USER_TURN_ON:
+ broadcastState(BluetoothAdapter.STATE_TURNING_ON);
if ((Boolean) message.obj) {
persistSwitchSetting(true);
}
// let it fall to TURN_ON_CONTINUE:
//$FALL-THROUGH$
case TURN_ON_CONTINUE:
- broadcastState(BluetoothAdapter.STATE_TURNING_ON);
mBluetoothService.switchConnectable(true);
transitionTo(mSwitching);
break;