Bug 976485 - [bluedroid] Fix sometimes Avrcp 1.3 play status is out of sync. r=gyeh

This commit is contained in:
Shawn Huang 2014-03-13 09:12:41 -04:00
parent 86e4ddf16b
commit 276d7a631f

View File

@ -910,6 +910,9 @@ BluetoothA2dpManager::UpdatePlayStatus(uint32_t aDuration,
#if ANDROID_VERSION > 17
NS_ENSURE_TRUE_VOID(sBtAvrcpInterface);
// always update playstatus first
sBtAvrcpInterface->get_play_status_rsp((btrc_play_status_t)aPlayStatus,
aDuration, aPosition);
// when play status changed, send both play status and position
if (mPlayStatus != aPlayStatus &&
mPlayStatusChangedNotifyType == BTRC_NOTIFICATION_TYPE_INTERIM) {
@ -931,8 +934,6 @@ BluetoothA2dpManager::UpdatePlayStatus(uint32_t aDuration,
&param);
}
sBtAvrcpInterface->get_play_status_rsp((btrc_play_status_t)aPlayStatus,
aDuration, aPosition);
mDuration = aDuration;
mPosition = aPosition;
mPlayStatus = aPlayStatus;
@ -958,7 +959,7 @@ BluetoothA2dpManager::UpdateRegisterNotification(int aEventId, int aParam)
switch (aEventId) {
case BTRC_EVT_PLAY_STATUS_CHANGED:
mPlayPosChangedNotifyType = BTRC_NOTIFICATION_TYPE_INTERIM;
mPlayStatusChangedNotifyType = BTRC_NOTIFICATION_TYPE_INTERIM;
param.play_status = (btrc_play_status_t)mPlayStatus;
break;
case BTRC_EVT_TRACK_CHANGE: