mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 09:19:28 +00:00
Bug 976485 - [bluedroid] Fix sometimes Avrcp 1.3 play status is out of sync. r=gyeh
This commit is contained in:
parent
86e4ddf16b
commit
276d7a631f
@ -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,
|
||||
¶m);
|
||||
}
|
||||
|
||||
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user