FileDocCategorySizeDatePackage
AudioMixingRule.javaAPI DocAndroid 5.1 API12254Thu Mar 12 22:22:30 GMT 2015android.media.audiopolicy

AudioMixingRule

public class AudioMixingRule extends Object
hide
Here's an example of creating a mixing rule for all media playback:
AudioAttributes mediaAttr = new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_MEDIA)
.build();
AudioMixingRule mediaRule = new AudioMixingRule.Builder()
.addRule(mediaAttr, AudioMixingRule.RULE_MATCH_ATTRIBUTE_USAGE)
.build();

Fields Summary
public static final int
RULE_MATCH_ATTRIBUTE_USAGE
A rule requiring the usage information of the {@link AudioAttributes} to match.
public static final int
RULE_MATCH_ATTRIBUTE_CAPTURE_PRESET
A rule requiring the capture preset information of the {@link AudioAttributes} to match.
private static final int
RULE_EXCLUSION_MASK
public static final int
RULE_EXCLUDE_ATTRIBUTE_USAGE
public static final int
RULE_EXCLUDE_ATTRIBUTE_CAPTURE_PRESET
private final int
mTargetMixType
private final ArrayList
mCriteria
Constructors Summary
private AudioMixingRule(int mixType, ArrayList criteria)

        mCriteria = criteria;
        mTargetMixType = mixType;
    
Methods Summary
java.util.ArrayListgetCriteria()

 return mCriteria; 
intgetTargetMixType()

 return mTargetMixType; 
public inthashCode()

        return Objects.hash(mTargetMixType, mCriteria);
    
private static booleanisPlayerRule(int rule)

        return ((rule == RULE_MATCH_ATTRIBUTE_USAGE)
                || (rule == RULE_EXCLUDE_ATTRIBUTE_USAGE));
    
private static booleanisValidIntRule(int rule)

        switch(rule) {
            case RULE_MATCH_ATTRIBUTE_USAGE:
            case RULE_EXCLUDE_ATTRIBUTE_USAGE:
            case RULE_MATCH_ATTRIBUTE_CAPTURE_PRESET:
            case RULE_EXCLUDE_ATTRIBUTE_CAPTURE_PRESET:
                return true;
            default:
                return false;
        }
    
private static booleanisValidSystemApiRule(int rule)

        switch(rule) {
            case RULE_MATCH_ATTRIBUTE_USAGE:
            case RULE_MATCH_ATTRIBUTE_CAPTURE_PRESET:
                return true;
            default:
                return false;
        }