通话录音:
从界面开始找代码,最后转了几个函数名,并转到多媒体录音模块
start_ record
voiceRecordClicked --- CallButtonFragment.java
|-------
com/android/incallui/CallButtonPresenter.java
public void voiceRecordClicked() {
TelecomAdapter.getInstance().startVoiceRecording();
}
|----
packages/apps/Dialer/InCallUI/src/com/android/incallui/TelecomAdapter.java
void startVoiceRecording() {
if (mInCallService != null) {
mInCallService.startVoiceRecording();
} else {
Log.e(this, "error startVoiceRecording, mInCallService is null");
}
}
|---- packages/services/Telecomm/src/com/android/server/telecom/InCallAdapter.java
public void startVoiceRecording()
PhoneRecorderHandler.getInstance().startVoiceRecord(activeCall,
|----import com.mediatek.telecom.recording.PhoneRecorderHandler
|------./Telecomm/src/com/mediatek/telecom/recording/PhoneRecorderHandler.java
public void startVoiceRecord(Call activeCall, final int customValue) {
mPhoneRecorder.startRecord();
private IPhoneRecorder mPhoneRecorder;
mRecordHandler = new RecordHandler(mWorkerThread.getLooper());
|----
./Telecomm/src/com/mediatek/telecom/recording/PhoneRecorder.java
public void startRecord() {
startRecording(MediaRecorder.O
|---./Telecomm/src/com/mediatek/telecom/recording/Recorder.java
private MediaRecorder mRecorder; 转化为多媒体里的录音模块
startRecording(int outputfileformat
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
mRecorder.start();
|-----AudioFlinger::RecordThread::RecordTrack::RecordTrack(
|------AudioFlinger::RecordThread::RecordTrack::start
|-----frameworks/av/media/libmedia/AudioRecord.cpp
|---- status_t AudioRecord::start(AudioSystem::sync_event_t
|----sp<IAudioRecord> AudioFlinger::openRecord(
|-----audio_module_handle_t AudioFlinger::loadHwModule_l(const char *name)