[Output Switcher] Check before use MediaController

Bug: 224715111
Test: verified on device
Change-Id: I4bce60d21f10f393f1711ef7f1ccceba8a39d9fb
This commit is contained in:
shaoweishen
2022-03-16 14:54:51 +00:00
committed by Shaowei Shen
parent fcd56e60dd
commit 3a45847457

View File

@@ -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;
}