当前位置:   article > 正文

Android 在卓智达对讲应用外使用PTT对讲按键无声

Android 在卓智达对讲应用外使用PTT对讲按键无声

/frameworks/av/services/audiopolicy/service/AudioPolicyService.cpp

抓log查看可见

MTK_ALOGD:

 

        MTK_ALOGD("APSMuteRec1 allowCapture[%d] hasOp[%d] canCaptureIfInCallOrCommunication[%d] State[%d] source[%d] [%zu]/[%zu] uid[%u] portId[%d] isA11yOnTop[%d] isAssistantOnTop[%d] isSensitiveActive[%d] isInCall[%d] isInCommunication[%d] rttCallActive[%d] onlyHotwordActive[%d] isTopOrLatestActive[%d] isTopOrLatestSensitive[%d] UIDTYPE[%d]/[%d]/[%d]"
            , allowCapture, current->hasOp(), canCaptureIfInCallOrCommunication(current), apmStatFromAmState(mUidPolicy->getUidState(currentUid)), source, i, mAudioRecordClients.size(), currentUid, current->portId, isA11yOnTop, isAssistantOnTop, isSensitiveActive
            , isInCall, isInCommunication, rttCallActive, onlyHotwordActive, isTopOrLatestActive, isTopOrLatestSensitive
            , mUidPolicy->isAssistantUid(currentUid), mUidPolicy->isA11yUid(currentUid), mUidPolicy->isCurrentImeUid(currentUid));

        /*/rm idle status stay on foreground or background
        setAppState_l(current,allowCapture ? apmStatFromAmState(mUidPolicy->getUidState(currentUid)) :APP_STATE_IDLE);
        //*/
         setAppState_l(current,apmStatFromAmState(mUidPolicy->getUidState(currentUid)));
        //*/

    }
}

void AudioPolicyService::silenceAllRecordings_l() {
    for (size_t i = 0; i < mAudioRecordClients.size(); i++) {
        sp<AudioRecordClient> current = mAudioRecordClients[i];
        if (!isVirtualSource(current->attributes.source)) {
            /*/add set idle status
            setAppState_l(current, APP_STATE_IDLE);
            //*/
            setAppState_l(current, APP_STATE_FOREGROUND);
            //*/

        }
    }
}

/* static */
app_state_t AudioPolicyService::apmStatFromAmState(int amState) {

    if (amState == ActivityManager::PROCESS_STATE_UNKNOWN) {
        /*/add。rm idle status
        return APP_STATE_IDLE;
        //*/
        return APP_STATE_FOREGROUND;
        //*/
    } else if (amState <= ActivityManager::PROCESS_STATE_TOP) {
      // include persistent services
      return APP_STATE_TOP;
    }
    return APP_STATE_FOREGROUND;
}

 

去掉当前闲置状态,设置为前台或后台运行/顶部即可

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/902770
推荐阅读
相关标签
  

闽ICP备14008679号