Change initial value of MediaSessionRecord.mDuration to -1
After the CL "a138573: AML: Remove unbundling MediaMetadata in
MediaSessionRecord" is merged, MediaController.getPlaybackState()
returned wrong position.
Since the mDuration is initially set to non-negative value,
getStateWithUpdatedPosition() limited the current position to the
duration, which is wrong.
As a result, the below androidx test failed in Q:
- MediaSessionCompatCallbackTest.testGetPlaybackStateWithPositionUpdate
This CL fixes the problem.
Bug: 121447576
Test: Passed above test
Change-Id: If87c844461a8204f3883cd3081f5c6f057ab36c6
1 file changed