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

Commit 23e548e9 authored by Michael Mikhail's avatar Michael Mikhail Committed by Android Build Coastguard Worker
Browse files

Add null check in background thread

Flag: NONE
Bug: 338367086
Test: build.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:fc721e423a0f2935dc422d7c292b083001cf1488)
Merged-In: I1bdbed4c6b7301263c67cc833f110d27b85637e2
Change-Id: I1bdbed4c6b7301263c67cc833f110d27b85637e2
parent ca29e733
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -382,16 +382,16 @@ public class NotificationMediaManager implements Dumpable {

    private void clearCurrentMediaNotificationSession() {
        mMediaMetadata = null;
        mBackgroundExecutor.execute(() -> {
            if (mMediaController != null) {
                if (DEBUG_MEDIA) {
                    Log.v(TAG, "DEBUG_MEDIA: Disconnecting from old controller: "
                            + mMediaController.getPackageName());
                }
            mBackgroundExecutor.execute(() -> {
                mMediaController.unregisterCallback(mMediaListener);
                mMediaController = null;
            });
            }
        });
    }

    public interface MediaListener {