Fix MediaPlayer construction with AUDIO_SESSION_ALLOCATE.
When AUDIO_SESSION_ALLOCATE is used during construction, the media player should allocate new unique session id. However, the previous call to native_set_session id tried to acquire session_id with value 0, which correspond to restricted OUTPUT_MIX session and caused failure during initialization. The topic also modifies the native initizalization code, so it's possible to pass explicit session id during construction of native MediaPlayer instance (prior to this change, the native constructor would always allocate new session id from audio server, even though in some cases it might have been immediately changed to exliplicitly requested session id). Bug: 263373078 Bug: 263362598 Test: atest MediaPlayerUnitTest Test: atest CtsMediaAudioTestCases CtsMediaPlayerTestCases Change-Id: I92b085e23c72e0b9d21e12792bf67c2497aa0e25
Loading
Please register or sign in to comment