zoukankan      html  css  js  c++  java
  • android电话接通状态下,关机铃声无法从外放输出

    AudioMTKPolicyManager.cpp的startOutput方法中。将在newDevic获取到的后面加入:
    if(stream==AudioSystem::BOOT)newDevice|=AUDIO_DEVICE_OUT_SPEAKER;
     
    status_t AudioMTKPolicyManager::startOutput(audio_io_handle_t output,
                                                 AudioSystem::stream_type stream,
                                                 int session)
    {
        ALOGD("startOutput() output %d, stream %d, session %d", output, stream, session);
        ......
        if (outputDesc->mRefCount[stream] == 1) {
            audio_devices_t newDevice = getNewDevice(output, false /*fromCache*/);
            routing_strategy strategy = getStrategy(stream);
            bool shouldWait = (strategy == STRATEGY_SONIFICATION) ||
                                (strategy == STRATEGY_SONIFICATION_RESPECTFUL);
            uint32_t waitMs = 0;
            bool force = false;
            if(stream==AudioSystem::BOOT) newDevice|=AUDIO_DEVICE_OUT_SPEAKER;
            for (size_t i = 0; i < mOutputs.size(); i++) {
                AudioOutputDescriptor *desc = mOutputs.valueAt(i);
                if (desc != outputDesc) {
                    // force a device change if any other output is managed by the same hw
                    // module and has a current device selection that differs from selected device.
                    // In this case, the audio HAL must receive the new device selection so that it can
                    // change the device currently selected by the other active output.
                    if (outputDesc->sharesHwModuleWith(desc) &&
                        desc->device() != newDevice) {
                        force = true;
                    }
                    // wait for audio on other active outputs to be presented when starting
                    // a notification so that audio focus effect can propagate.
                    uint32_t latency = desc->latency();
                    if (shouldWait && desc->isActive(latency * 2) && (waitMs < latency)) {
                        waitMs = latency;
                    }
                }
            }
          ......      
        }
        return NO_ERROR;
    }
  • 相关阅读:
    ORA-01157:无法标识/锁定数据文件,ORA-01110:表空间丢失错误
    Oracle ORA-01033: ORACLE initialization or shutdown in progress
    mysql delete语句不能用别名
    内存溢出
    中间件-RocketMQ-启动
    rz上传文件乱码
    字节码解读(转~谨用作记录)
    java字节码指令列表(转)
    idea打jar包,提示 jar包中没有主清单属性
    MYSQL 查看最大连接数和修改最大连接数
  • 原文地址:https://www.cnblogs.com/zfyouxi/p/5160731.html
Copyright © 2011-2022 走看看