Skip to content

Commit 88a89b2

Browse files
jmtriviAndroid (Google) Code Review
authored andcommitted
Merge "Always queue A2DP connection state message with wakelock held" into jb-dev
2 parents 622976b + e12c39b commit 88a89b2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

media/java/android/media/AudioService.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ public class AudioService extends IAudioService.Stub implements OnFinished {
135135
private static final int MSG_RCDISPLAY_UPDATE = 13;
136136
private static final int MSG_SET_ALL_VOLUMES = 14;
137137
private static final int MSG_PERSIST_MASTER_VOLUME_MUTE = 15;
138-
private static final int MSG_SET_WIRED_DEVICE_CONNECTION_STATE = 16;//handled under wakelock
139-
private static final int MSG_SET_A2DP_CONNECTION_STATE = 17; //handled under wakelock
138+
// messages handled under wakelock, can only be queued, i.e. sent with queueMsgUnderWakeLock(),
139+
// and not with sendMsg(..., ..., SENDMSG_QUEUE, ...)
140+
private static final int MSG_SET_WIRED_DEVICE_CONNECTION_STATE = 16;
141+
private static final int MSG_SET_A2DP_CONNECTION_STATE = 17;
140142

141143

142144
// flags for MSG_PERSIST_VOLUME indicating if current and/or last audible volume should be
@@ -1962,9 +1964,8 @@ public void onServiceConnected(int profile, BluetoothProfile proxy) {
19621964
int delay = checkSendBecomingNoisyIntent(
19631965
AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP,
19641966
(state == BluetoothA2dp.STATE_CONNECTED) ? 1 : 0);
1965-
sendMsg(mAudioHandler,
1967+
queueMsgUnderWakeLock(mAudioHandler,
19661968
MSG_SET_A2DP_CONNECTION_STATE,
1967-
SENDMSG_QUEUE,
19681969
state,
19691970
0,
19701971
btDevice,

0 commit comments

Comments
 (0)