mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

MediaDrm.provideXResponse methods only accept the response corresponding to the most recent MediaDrm.getXRequest call. Previously, our code allowed the following incorrect call sequence: a = getKeyRequest b = getKeyRequest provideKeyResponse(responseFor(a)); This would occur in the edge case of a second key request being triggered whilst the first was still in flight. The provideKeyResponse call would then fail. This change fixes the problem by treating responseFor(a) as stale. Note that a slightly better fix would be to defer calling getKeyRequest the second time until after processing the response corresponding to the first one, however this is significantly harder to implement, and is probably not worth it for what should be an edge case. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=203481685