Merge "Hide the "play media to" option" into rvc-dev am: 2152d0ce4f

Change-Id: I50adccf9f3fa816cefbec2490c50657be577cf29
This commit is contained in:
TreeHugger Robot
2020-04-27 10:07:45 +00:00
committed by Automerger Merge Worker
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;
}
}