Merge "Hide the "play media to" option" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-04-27 09:55:56 +00:00
committed by Android (Google) Code Review
2 changed files with 31 additions and 2 deletions

View File

@@ -120,14 +120,17 @@ public class MediaOutputIndicatorSlice implements CustomSliceable {
return mWorker;
}
private boolean isVisible() {
@VisibleForTesting
boolean isVisible() {
// To decide Slice's visibility.
// Return true if
// 1. AudioMode is not in on-going call
// 2. worker is not null
// 3. Available devices are more than 0
// 4. The local media session is active and the state is playing.
return getWorker() != null
&& !com.android.settingslib.Utils.isAudioModeOngoingCall(mContext)
&& getWorker().getMediaDevices().size() > 0;
&& getWorker().getMediaDevices().size() > 0
&& getWorker().getActiveLocalMediaController() != null;
}
}