热点新闻事件100字,seoheuni,seo搜索优化是什么呢,青浦建设机械网站转载自http://blog..net/xiashaohua/article/details/53842337只简单描述调用过程#xff0c;需对照代码看#xff0c;不画图了#xff0c;也不贴代码)1.在key Event处理部分#xff0c;Phonewindow会捕获到音量按键事件#xff0c;Phonewindow.onkeydown--MediaSessionLe…转载自http://blog..net/xiashaohua/article/details/53842337只简单描述调用过程需对照代码看不画图了也不贴代码)1.在key Event处理部分Phonewindow会捕获到音量按键事件Phonewindow.onkeydown--MediaSessionLegacyHelper.getHelper(getContext()).sendAdjustVolumeBy2.调节音量的时候要处理3件事情界面显示、播放提示音、调节音量MediaSessionManager. dispatchAdjustVolume--mService.dispatchAdjustVolume/binder-- MediaSessionService. dispatchAdjustVolume—dispatchAdjustVolumeLocked--mAudioService.adjustSuggestedStreamVolume(如使用AudioManager则AudioManager 的handleKeyDown、handleKeyUp也可来设置音量。handleKeyDown--adjustSuggestedStreamVolume--MediaSessionLegacyHelper.sendAdjustVolumeBy—)3.在Audio模块mAudioService.adjustSuggestedStreamVolume(direction,suggestedStream,flags, packageName, TAG);/binder– AudioService.adjustSuggestedStreamVolume—adjustStreamVolume/这里做了些场景处理和判断将APS的工作提前做了之后a)调音量走 --sendMsg(mAudioHandler,MSG_SET_DEVICE_VOLUME,SENDMSG_QUEUE,device,0,streamState,0);-- setDeviceVolume--mStreamStates[streamType].applyDeviceVolume_syncVSS(streamDevice)-- AudioSystem.setStreamVolumeIndex/jni-- AudioSystem.setStreamVolumeIndex--aps-setStreamVolumeIndex(stream, index, device)/binder-- AudioPolicyInterfaceImpl.cppsetStreamVolumeIndex-- mAudioPolicyManager-setStreamVolumeIndex—checkAndSetVolume—调一般的音量调用outputDesc-setVolume待后面打开output调节音量使用调正在播放的铃声音量不在这个地方。调通话中音量走mpClientInterface-setVoiceVolume-- AudioPolicyService::AudioPolicyClient::setVoiceVolume-- mAudioPolicyService-setVoiceVolume -- AudioPolicyService::setVoiceVolume -- mAudioCommandThread-voiceVolumeCommand/SET_VOICE_VOLUME-- AudioSystem::setVoiceVolume -- af-setVoiceVolume -- dev-set_voice_volume--audio_hw.c adev_set_voice_volume-- voice_set_volume-- …这个调音量的流程也是够够的了从jni下来后AS—APS—APM—APS—AS—AF—HAL这样走了一大圈。b)调界面走 —sendVolumeUpdate-- mVolumeController.postVolumeChanged(streamType,flags);-- mController.volumeChanged/binder--VolumeDialogController. volumeChanged-- mWorker.obtainMessage(W.VOLUME_CHANGED, streamType,flags).sendToTarget();--onVolumeChangedW--…4.对于通过outPut设置音量的部分如果是deepbuffer播放就不会调用下来如果是offload播放在audio_hw.c里面static intout_set_volume(struct audio_stream_out *stream, float left,float right)out-stream.set_volume out_set_volume;在audioflinger里面就调整了Threads.cpp(frameworks\av\services\audioflinger): if (mOutput-stream-set_volume) {Threads.cpp (frameworks\av\services\audioflinger): mOutput-stream-set_volume(mOutput-stream, left, right);5.在audio_hw.c里面流程如下out_set_volume--passthru.caudio_extn_passthru_set_volume--platform.c platform_set_device_params顶0踩