Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Permission, required="false", fail

My application provides the user with optional access to SMS and Phone calls. I have used:

 <uses-permission android:name="android.permission.READ_PHONE_STATE" android:required="false"></uses-permission>
 <uses-permission android:name="android.permission.SEND_SMS" android:required="false"></uses-permission>
 <uses-permission android:name="android.permission.CALL_PHONE" android:required="false"></uses-permission>

Google Play does not expose this application to devices that do not have cellular network access. It seems like the required = false parameter is failing to do its job.

Is this a bug? Is there something else that I can do?

like image 488
Xarph Avatar asked May 22 '12 18:05

Xarph


People also ask

What is Android permission dump?

The DUMP permission is defined as android:protectionLevel="signatureOrSystem" so you can't get it unless your app is signed with the platform key, or installed in the system partition.

What is Android permission Get_accounts?

android.permission.GET_ACCOUNTS. Allows access to the list of accounts in the Accounts Service. The app uses this permission in an effort to find the device user's name when the support session is presented to a representative.

What does READ_PHONE_STATE permission do?

READ_PHONE_STATE is one of the Android permissions categorized as dangerous. This is because it “allows read only access to phone state, including the phone number of the device, current cellular network information, the status of any ongoing calls, and a list of any Phone Accounts registered on the device” [2] .


1 Answers

You don´t need to use the property android:required in <uses-permission it only works for <uses-feature, see the definition of

uses-feature : To control filtering, always explicitly declare hardware features in elements, rather than relying on Google Play to "discover" the requirements in <uses-permission> elements. Then, if you want to disable filtering for a particular feature, you can add a android:required="false" attribute to the declaration.

this is the list of permissions that imply hardware features:

https://developer.android.com/guide/topics/manifest/uses-feature-element.html#permissions-features

Based on your elements:

you probably need to add only :

<uses-feature android:name="android.hardware.telephony" android:required="false" />
like image 62
Jorgesys Avatar answered Oct 15 '22 03:10

Jorgesys