Fix potential NPE/ThreadSafety issues with MediaDrm listener
- MediaDrmEventListener.onEvent is typically called on the app's main thread. mediaDrmHandler is instantiated on the playback thread. Hence mediaDrmHandler should be volatile to ensure visibility. - Nulling mediaDrmHandler could result in a NPE in onEvent. Instantiate mediaDrmHandler (and don't null it again) to avoid this. MediaDrmHandler.handleMessage will correctly discard any events for sessions that are now closed. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=168707938
Showing
with
11 additions
and
15 deletions
Please
register
or
sign in
to comment