From 3a45847457522930a76bd4535803865c1ff9028f Mon Sep 17 00:00:00 2001 From: shaoweishen Date: Wed, 16 Mar 2022 14:54:51 +0000 Subject: [PATCH] [Output Switcher] Check before use MediaController Bug: 224715111 Test: verified on device Change-Id: I4bce60d21f10f393f1711ef7f1ccceba8a39d9fb --- .../android/systemui/media/dialog/MediaOutputController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java index ea7f7f2bb6461..1cc96c0fd0de9 100644 --- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java +++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java @@ -637,7 +637,8 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback, } private boolean isPlayBackInfoLocal() { - return mMediaController.getPlaybackInfo() != null + return mMediaController != null + && mMediaController.getPlaybackInfo() != null && mMediaController.getPlaybackInfo().getPlaybackType() == MediaController.PlaybackInfo.PLAYBACK_TYPE_LOCAL; }