The pit of Android call recording

Originally, today's article is going to provide you with a technical article to talk about Android automatic call recording. I have used this technology in an APP before, I thought there was no problem, but I jumped into a pit today. Since I have already entered the pit, I will briefly describe it to prevent everyone from entering the pit again.


Previously, the need for phone recording was very simple. When an incoming or outgoing call was made, the mobile phone would automatically record. Regarding the status of Android monitoring phone calls, I have a Demo here, so I won't describe it in detail. You can go to github to have a look. The address is

https://github.com/yjp19871013/PhoneStateDemo


There are two ways to monitor the phone status, one is to use Broadcast Receiver, the other is to use TelephonyManager to set the listener, both methods are involved in the code, but use one to comment out the other code.


The phone status monitoring has been solved, so it is time to deal with the recording problem. The pit is here. You can use MediaRecorder or AudioRecorder for recording. The previous project was based on the system before 4.2, so it worked very well, but this time it is based on 5.0 or above. system, the problem is coming. AudioSource needs to be set when recording. It was no problem to use MIC and VOICE_CALL as the sound source for recording before. However, due to Google's consideration of privacy issues, basically we can't get the sound of the other end!


You may wonder why the dialer program that comes with your phone can record? Indeed, after consulting the information, I learned that if your application is used as a system application, you can get the voice of the peer. So how can your app become a system app? In the past, this could be achieved by configuring the manifest file, but now this is not feasible. You need to compile your APP in the operating system source code!


Therefore, in the current new version of the system, if you still want to make an application to perform two-way recording of calls, it seems to be a little difficult, and no good way has been found so far. I also hope that friends who have experience in this area can share it.


Looking back on doing this function at the time, although the company used it internally, it felt that it involved privacy. Well now, it seems to be unusable. The code life is so short, it can be seen that the edge ball is still less.


The product is not imaginary, it is limited by various aspects, and the cost of research and development also exists. It is worth thinking about how much the cost of investment in research and development will get in return. Lessons learned is that companies and R&D should have their own judgments, not just considering whether the technology is feasible, but also whether it is related to privacy, ethics and law. There are some things that may be technically feasible, but, perhaps soon, the technical Support is blocked, and in the end, the gains outweigh the losses. If our product once provided a feature, but then removed it, it would inevitably drive some users away. How to use technology is a question worth thinking about.


Recently, the incident of ZTE employees jumping off the building has become quite popular. For the time being, no matter what the result is, I just feel that as a technical person, it seems to be very powerful, but the power is so weak. Technology may make us omnipotent, but technical people should have All do not do.


This week's technical implementation failed, and I didn't prepare any topics. I thought of writing where I wanted to, and sometimes it felt good to relax myself XD.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325581304&siteId=291194637