Joke Collection Website - Public benefit messages - Can Android phones refuse to answer blacklisted calls?
Can Android phones refuse to answer blacklisted calls?
As long as the phone is turned on and there is a signal, you can receive the other party's information. When it is set to call rejection or blacklist, if the other party sends a short message, the mobile phone can still receive this short message. SMS is stored in your mobile phone blacklist or call rejection record, which contains not only the call rejection record, but also the SMS interception record.
SMS interception is actually a relatively simple one. There are many related introductions on the Internet. Here I mainly introduce some problems encountered in the writing process.
First of all, the principle of SMS interception is to monitor the playback of SMS, and then judge whether the number of SMS is blacklisted or not. If so, the broadcast transmission is ended through abortBroadcast. Among them, the most important problem in the process of doing it is not to receive interception, but to receive interception first. Because SMS broadcasting is an orderly broadcast, whoever receives the broadcast first has the right to end the transmission of the broadcast, so we should actually find ways to raise our permission to receive the broadcast to the highest level. There are two main methods here, 1 is to set the maximum weight limit, and 2 is to set the registration mode as dynamic registration.
Setting the maximum permissions is actually setting the maximum priority when registering for broadcasting. The api of Android system declares that the maximum permission is 1000, but actually it receives an int value, and the system has no online judgment value, so we can set the maximum value of int, and this permission is the highest.
Then, if they are all the maximum permissions and whose priority is higher, then it is the second point, dynamic registration monitoring. Because the broadcast registered dynamically in the source code is put into the monitoring list before the static broadcast, we use dynamic registration to set up monitoring here.
Then if everyone uses dynamic registration, who will receive it first? This place seems to have something to do with the package name of the application. I don't quite understand. The earlier the installation time, the higher the priority, and the higher the alias order of package names in the system (not the alphabetical order of package names we wrote).
Then let's look at the concrete implementation. First, build a service, and then ensure that this service always runs in the background (it can always exist in the form of daemon, monitoring and guiding broadcast, etc.). ), and then register the broadcast and deregister it in the onStartCommand and onDestroy methods of the service respectively.
- Previous article:Did Yun Qi Assets Company really send a reminder letter?
- Next article:Ask 6. 1 birthday message.
- Related articles
- How to deal with power outage?
- On May 17, Yunnan Mobile sent 6g traffic. What is the order of use? Why am I still using myself?
- What does Tianlong Babu WeChat scan code authorize?
- How to send text messages between Shanghai and Taiwan
- Say hello to your boyfriend and don't return text messages.
- 106 SMS charging standard
- Can a mobile phone send short messages by phone? Old people can't type I want to ask. Noki dumb brand is the best. Thank you.
- What's the matter with the apple 1 1 input method?
- Can Unicom check the service password when sending text messages? How to query if you can! !
- How to write short Valentine's Day greetings in Valentine's Day copywriting