Merge "[Output switcher] Check current device" into tm-dev am: 49ab839806 am: 3add1e63d4

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17608150

Change-Id: Ie3486080f01a905856860aee07e9abd5c70effdd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Shaowei Shen
2022-04-12 01:28:52 +00:00
committed by Automerger Merge Worker

View File

@@ -88,8 +88,11 @@ public class MediaOutputDialog extends MediaOutputBaseDialog {
@Override
int getStopButtonVisibility() {
boolean isActiveRemoteDevice = mMediaOutputController.isActiveRemoteDevice(
mMediaOutputController.getCurrentConnectedMediaDevice());
boolean isActiveRemoteDevice = false;
if (mMediaOutputController.getCurrentConnectedMediaDevice() != null) {
isActiveRemoteDevice = mMediaOutputController.isActiveRemoteDevice(
mMediaOutputController.getCurrentConnectedMediaDevice());
}
boolean isBroadCastSupported = isBroadcastSupported();
return (isActiveRemoteDevice || isBroadCastSupported) ? View.VISIBLE : View.GONE;