码迷,mamicode.com
首页 > 移动开发 > 详细

Android 通话:后台通话过程中锁屏解锁,发现听筒内存在锁屏提示音

时间:2015-06-09 17:17:29      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:

【系统版本】:T0316
【 HW 】:p1
【测试前提】:1.卡1插入移动4G卡
【测试步骤】:1.呼入或呼出一通来电,接听;
2.按home返回后台,锁屏解锁查看。
【测试结果】:1.后台通话过程中锁屏解锁,发现听筒内存在锁屏提示音
【预期结果】:1.通话过程中不应存在锁屏提示音

【概 率】:必现

solution:

修改文件:./frameworks/av/services/audiopolicy/AudioPolicyManager.cpp

status_t AudioPolicyManager::checkAndSetVolume(audio_stream_type_t stream,
                                                   int index,
                                                   audio_io_handle_t output,
                                                   audio_devices_t device,
                                                   int delayMs,
                                                   bool force)
{
    ALOGD(" checkAndSetVolume stream = %d index = %d output = %d device = 0x%x delayMs = %d force = %d"
        ,stream,index,output,device,delayMs,force);
    // do not change actual stream volume if the stream is muted
    if (mOutputs.valueFor(output)->mMuteCount[stream] != 0) {
        ALOGVV("checkAndSetVolume() stream %d muted count %d",
              stream, mOutputs.valueFor(output)->mMuteCount[stream]);
        return NO_ERROR;
    }
    //add start
    if(stream == AUDIO_STREAM_SYSTEM && isInCall())
        index=0;
    //add end

    // do not change in call volume if bluetooth is connected and vice versa
    if ((stream == AUDIO_STREAM_VOICE_CALL &&
            mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION] == AUDIO_POLICY_FORCE_BT_SCO) ||
        (stream == AUDIO_STREAM_BLUETOOTH_SCO &&
                mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION] != AUDIO_POLICY_FORCE_BT_SCO)) {
        ALOGD("checkAndSetVolume() cannot set stream %d volume with force use = %d for comm",
             stream, mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION]);
        return INVALID_OPERATION;
    }
    //..................
}
可以添加代码

if(stream == AUDIO_STREAM_SYSTEM && isInCall())
        index=0;
过滤掉系统声音可以对这个问题进行规避

Android 通话:后台通话过程中锁屏解锁,发现听筒内存在锁屏提示音

标签:

原文地址:http://blog.csdn.net/deng0zhaotai/article/details/46427621

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!