diff --git a/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp b/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp index 6a581a22a290..c9dac94c4c17 100644 --- a/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp +++ b/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp @@ -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: