author | Shawn Huang <shuang@mozilla.com> |
Thu, 13 Mar 2014 09:12:41 -0400 | |
changeset 173417 | f351db5f11896ea30eaa2d30634fadfd5d75dee7 |
parent 173416 | e574778a856384fea69bfd29b7d4ddcc7458960a |
child 173418 | ebba55b7f0d8d56fc9ecf68596e369bf8e4d8ea4 |
push id | 41000 |
push user | ryanvm@gmail.com |
push date | Thu, 13 Mar 2014 19:35:12 +0000 |
treeherder | mozilla-inbound@6247f6502793 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | gyeh |
bugs | 976485 |
milestone | 30.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp +++ b/dom/bluetooth/bluedroid/BluetoothA2dpManager.cpp @@ -905,16 +905,19 @@ void BluetoothA2dpManager::UpdatePlayStatus(uint32_t aDuration, uint32_t aPosition, ControlPlayStatus aPlayStatus) { MOZ_ASSERT(NS_IsMainThread()); #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) { btrc_register_notification_t param; param.play_status = (btrc_play_status_t)aPlayStatus; mPlayStatusChangedNotifyType = BTRC_NOTIFICATION_TYPE_CHANGED; sBtAvrcpInterface->register_notification_rsp(BTRC_EVT_PLAY_STATUS_CHANGED, BTRC_NOTIFICATION_TYPE_CHANGED, @@ -926,18 +929,16 @@ BluetoothA2dpManager::UpdatePlayStatus(u btrc_register_notification_t param; param.song_pos = aPosition; mPlayPosChangedNotifyType = BTRC_NOTIFICATION_TYPE_CHANGED; sBtAvrcpInterface->register_notification_rsp(BTRC_EVT_PLAY_POS_CHANGED, BTRC_NOTIFICATION_TYPE_CHANGED, ¶m); } - sBtAvrcpInterface->get_play_status_rsp((btrc_play_status_t)aPlayStatus, - aDuration, aPosition); mDuration = aDuration; mPosition = aPosition; mPlayStatus = aPlayStatus; #endif } /* * This function handles RegisterNotification request from @@ -953,17 +954,17 @@ BluetoothA2dpManager::UpdateRegisterNoti #if ANDROID_VERSION > 17 NS_ENSURE_TRUE_VOID(sBtAvrcpInterface); btrc_register_notification_t param; 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: // In AVRCP 1.3 and 1.4, the identifier parameter of EVENT_TRACK_CHANGED // is different. // AVRCP 1.4: If no track is selected, we shall return 0xFFFFFFFFFFFFFFFF, // otherwise return 0x0 in the INTERRIM response. The expanded text in // version 1.4 is to allow for new UID feature. As for AVRCP 1.3, we shall