|
|
|
@ -47,32 +47,29 @@ void AudioPolicyMix::dump(String8 *dst, int spaces, int index) const
|
|
|
|
|
|
|
|
|
|
int indexCriterion = 0;
|
|
|
|
|
for (const auto &criterion : mCriteria) {
|
|
|
|
|
dst->appendFormat("%*s- Criterion %d:\n", spaces + 2, "", indexCriterion++);
|
|
|
|
|
|
|
|
|
|
std::string usageLiteral;
|
|
|
|
|
if (!UsageTypeConverter::toString(criterion.mValue.mUsage, usageLiteral)) {
|
|
|
|
|
ALOGE("%s: failed to convert usage %d", __FUNCTION__, criterion.mValue.mUsage);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
dst->appendFormat("%*s- Usage:%s\n", spaces + 4, "", usageLiteral.c_str());
|
|
|
|
|
|
|
|
|
|
if (mMixType == MIX_TYPE_RECORDERS) {
|
|
|
|
|
std::string sourceLiteral;
|
|
|
|
|
if (!SourceTypeConverter::toString(criterion.mValue.mSource, sourceLiteral)) {
|
|
|
|
|
ALOGE("%s: failed to convert source %d", __FUNCTION__, criterion.mValue.mSource);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
dst->appendFormat("%*s- Source:%s\n", spaces + 4, "", sourceLiteral.c_str());
|
|
|
|
|
|
|
|
|
|
dst->appendFormat("%*s- Criterion %d: ", spaces + 2, "", indexCriterion++);
|
|
|
|
|
|
|
|
|
|
std::string ruleType, ruleValue;
|
|
|
|
|
bool unknownRule = !RuleTypeConverter::toString(criterion.mRule, ruleType);
|
|
|
|
|
switch (criterion.mRule & ~RULE_EXCLUSION_MASK) { // no need to match RULE_EXCLUDE_...
|
|
|
|
|
case RULE_MATCH_ATTRIBUTE_USAGE:
|
|
|
|
|
UsageTypeConverter::toString(criterion.mValue.mUsage, ruleValue);
|
|
|
|
|
break;
|
|
|
|
|
case RULE_MATCH_ATTRIBUTE_CAPTURE_PRESET:
|
|
|
|
|
SourceTypeConverter::toString(criterion.mValue.mSource, ruleValue);
|
|
|
|
|
break;
|
|
|
|
|
case RULE_MATCH_UID:
|
|
|
|
|
ruleValue = std::to_string(criterion.mValue.mUid);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
unknownRule = true;
|
|
|
|
|
}
|
|
|
|
|
dst->appendFormat("%*s- Uid:%d\n", spaces + 4, "", criterion.mValue.mUid);
|
|
|
|
|
|
|
|
|
|
std::string ruleLiteral;
|
|
|
|
|
if (!RuleTypeConverter::toString(criterion.mRule, ruleLiteral)) {
|
|
|
|
|
ALOGE("%s: failed to convert source %d", __FUNCTION__,criterion.mRule);
|
|
|
|
|
return;
|
|
|
|
|
if (!unknownRule) {
|
|
|
|
|
dst->appendFormat("%s %s\n", ruleType.c_str(), ruleValue.c_str());
|
|
|
|
|
} else {
|
|
|
|
|
dst->appendFormat("Unknown rule type value 0x%x\n", criterion.mRule);
|
|
|
|
|
}
|
|
|
|
|
dst->appendFormat("%*s- Rule:%s\n", spaces + 4, "", ruleLiteral.c_str());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|