Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79e4b948 authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "MediaPlayer2Impl: avoid NPE when accessing mHandlerThread"

parents 6b3cb1e3 c88f5760
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -700,7 +700,8 @@ public final class MediaPlayer2Impl extends MediaPlayer2 {
    // return true if there is a next data source, false otherwise.
    // This function should be always called on |mHandlerThread|.
    private boolean prepareNextDataSource() {
        if (Looper.myLooper() != mHandlerThread.getLooper()) {
        HandlerThread handlerThread = mHandlerThread;
        if (handlerThread != null && Looper.myLooper() != handlerThread.getLooper()) {
            Log.e(TAG, "prepareNextDataSource: called on wrong looper");
        }

@@ -736,7 +737,8 @@ public final class MediaPlayer2Impl extends MediaPlayer2 {

    // This function should be always called on |mHandlerThread|.
    private void playNextDataSource() {
        if (Looper.myLooper() != mHandlerThread.getLooper()) {
        HandlerThread handlerThread = mHandlerThread;
        if (handlerThread != null && Looper.myLooper() != handlerThread.getLooper()) {
            Log.e(TAG, "playNextDataSource: called on wrong looper");
        }