Permission required when using Intent to call a phone?

In one of my applications, I use the following code to call a phone:

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

The docs say that for this I need the following Manifest permission:

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

Is it really necessary? I do not understand the difference between the phone and the camera function. When using phone intent, I need permission, but I don't need permission for camera intent:

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

Is there a list of hardware functions that need permission if they are launched using intent, and those that do not?

+8
android android-intent permissions
source share
3 answers

Is it really necessary?

Yes.

I do not understand the difference between the phone and the camera function.

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

Taking pictures with a camera usually does not require money from you.

Is there a list of hardware functions that need permission if they are launched using intent, and those that do not?

Not really.

+12
source share

Actually, if you just want to open dialing with a specific phone number, without a direct call (user confirmation is required), you can do this without any permissions:

 startActivity( new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + PhoneNumber))); 
+19
source share

When you send a request to the camera, it simply opens an application that requires user interaction before it can do anything.

Phone calls open the application with the phone number already entered, so just click the button.

There is a much higher risk that you accidentally call someone than if you accidentally took a picture (which you could just delete if you accidentally took it).

+1
source share

All Articles