使用Intent拨打电话时需要许可吗? [英] Permission required when using Intent to call phone?

查看:94
本文介绍了使用Intent拨打电话时需要许可吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的一个应用中,我正在使用以下代码来发出电话:

In one of my apps I'm using the following code to issue a phone call:

Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(...)); 
startActivity(intent);

文档说,我确实需要以下清单权限才能这样做:

The docs say I do need the following Manifest permission to do so:

<uses-permission android:name="android.permission.CALL_PHONE" />

这真的是必需的吗?我不了解手机和相机功能之间的区别.使用电话意图时,我确实需要权限,但不需要摄像头意图:

Is this really required? I do not understand the difference between a phone and a camera feature. When using a phone intent I do need a permission but I don't need permission for a camera intent:

Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
...
startActivityForResult(intent, 1);

是否有列表,列出了借助意图触发而需要许可的硬件功能,以及不需要的许可?

Is there a list on hardware features that need a permission if fired with the help of an intent and those that don't?

推荐答案

真的需要吗?

Is this really required?

是的

我不了解手机和摄像头功能之间的区别.

I do not understand the difference between a phone and a camera feature.

打来的电话会让人花钱.因此,如果您直接拨打电话(vs. ACTION_DIAL只是将号码放入拨号器),则Android希望用户提前同意以允许这样做.

Phone calls can cost people money. Hence, if you directly place a phone call (vs. ACTION_DIAL to just put the number in the dialer), Android wants the user to agree ahead of time to allow this.

使用相机拍照通常不会直接花费用户任何金钱.

Taking pictures with the camera does not usually directly cost users any money.

是否有列表,列出了借助意图触发而需要许可的硬件功能,以及不需要的许可?

Is there a list on hardware features that need a permission if fired with the help of an intent and those that don't?

不是真的.

这篇关于使用Intent拨打电话时需要许可吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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