Merge "Not support group volume control" into sc-dev
This commit is contained in:
@@ -259,6 +259,10 @@ public class MediaDeviceUpdateWorker extends SliceBackgroundWorker
|
||||
return mLocalMediaManager.shouldDisableMediaOutput(packageName);
|
||||
}
|
||||
|
||||
boolean shouldEnableVolumeSeekBar(RoutingSessionInfo sessionInfo) {
|
||||
return mLocalMediaManager.shouldEnableVolumeSeekBar(sessionInfo);
|
||||
}
|
||||
|
||||
private class DevicesChangedBroadcastReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
@@ -126,6 +126,12 @@ public class RemoteMediaSlice implements CustomSliceable {
|
||||
+ maxVolume);
|
||||
continue;
|
||||
}
|
||||
if (!getWorker().shouldEnableVolumeSeekBar(info)) {
|
||||
// There is no disable state. We hide it directly.
|
||||
Log.d(TAG, "Unable to add Slice. " + info.getName() + ": This is a group session");
|
||||
continue;
|
||||
}
|
||||
|
||||
final CharSequence appName = Utils.getApplicationLabel(
|
||||
mContext, info.getClientPackageName());
|
||||
final CharSequence outputTitle = mContext.getString(R.string.media_output_label_title,
|
||||
|
@@ -129,6 +129,7 @@ public class RemoteVolumeGroupController extends BasePreferenceController implem
|
||||
seekBarPreference.setMin(0);
|
||||
seekBarPreference.setOnPreferenceChangeListener(this);
|
||||
seekBarPreference.setIcon(R.drawable.ic_volume_remote);
|
||||
seekBarPreference.setEnabled(mLocalMediaManager.shouldEnableVolumeSeekBar(info));
|
||||
mPreferenceCategory.addPreference(seekBarPreference);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user