有什么方法可以在Android KitKat中以编程方式阻止SMS? [英] Is there any way to block SMS programmatically in Android KitKat?

查看:53
本文介绍了有什么方法可以在Android KitKat中以编程方式阻止SMS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于Google对消息传递的方式进行了许多更改,因此这在Android Kitkat中是完全不可能的吗?我曾尝试使用广播接收器和abortBroadcast,但无济于事.

Is this completely and utterly impossible in android Kitkat since Google has made so many changes to the way messaging works? I have tried using broadcast receivers and abortBroadcast, but to no avail.

推荐答案

有什么方法可以在Android KitKat中以编程方式阻止SMS?

Is there any way to block SMS programmatically in Android KitKat?

不.从KitKat开始, SMS_RECEIVED 广播不能中止,因此任何具有 RECEIVE_SMS 权限的应用程序仍可以侦听并检索传入的消息.如果您的应用程序是默认应用程序,则可以选择不将消息写到提供程序,因此它不会出现在向提供程序查询消息的任何应用程序中,但是即使默认应用程序也无法中止 SMS_RECEIVED 广播.

No. Starting with KitKat, the SMS_RECEIVED broadcast cannot be aborted, so any app with the RECEIVE_SMS permission can still listen for it and retrieve the incoming message. If your app is the default app, it can choose not to write the message to the Provider, so it will not appear to any app querying the Provider for messages, but even the default app cannot abort the SMS_RECEIVED broadcast.

这篇关于有什么方法可以在Android KitKat中以编程方式阻止SMS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆