我的问题是如何将我的应用程序添加到android默认拨号程序选择中,以便在不使用android.intent.action.call_特权的情况下更加具体?
现在我正在使用下面的代码,它可以正常工作:
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
不过,谷歌最近发布的消息是:http://productforums.google.com/forum/#!topic/mobile/wXqnbynsL8Y
并将此邮件发送给使用intent android.intent.action.call_privileged的程序:
问题:
应用程序的用户可能无法紧急处理
通过系统电话拨号器拨打电话,如果他们选择
您的应用程序路由调用。如文件所述,
侦听调用特权意图操作的应用程序将
拦截来自系统的紧急服务呼叫,但可能无法
以正确的路线。请注意,呼叫特权是
受限API,不用于第三方应用程序
无法正确安排紧急呼叫。
解决方案:
•从Java代码和androidmanifest.xml中的意图过滤器中删除call_privileged。
•更新你的google play列表
包含将应用程序用作默认应用程序的语句的说明
拨号程序可能会干扰拨打911紧急服务。
最简单的解决方案是删除,但应用程序将使用功能。但是,是否有其他方法可以将应用程序添加到默认拨号程序选择中?但如果没有电话的特权意图呢?
提前谢谢
只是默认拨号程序选择的一个示例
编辑:
我使用的其他意图:
<intent-filter>
<action android:name="android.intent.action.CALL_BUTTON" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel"/>
</intent-filter>
最佳答案
<intent-filter>
<action android:name="android.intent.action.CALL_PRIVILEGED" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="tel" />
</intent-filter>
更重要的是,在intent filter中需要特权调用操作,数据作为uri的“tel”。
下面的许可标签还需要允许打电话。
类别启动程序中的代码中缺少。
<uses-permission android:name="android.permission.CALL_PHONE" />