Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does android:required="false" mean WRT to uses-permission?

I'm integrating an SDK and it requires I put this:

<uses-permission
    android:name="android.permission.ACCESS_FINE_LOCATION"
    android:required="false" />

I understand android:required="false" on a uses-feature, but I can't understand the meaning on a permission. It's not listed in the docs as a attribute.

Is it similar to requires on a uses-feature? Where permissions imply features as listed here, then those features are not required?

like image 248
weston Avatar asked Oct 03 '13 18:10

weston


People also ask

What is the uses-permission in Android?

Specifies a system permission that the user must grant in order for the app to operate correctly. Permissions are granted by the user when the application is installed (on devices running Android 5.1 and lower) or while the app is running (on devices running Android 6.0 and higher).

What is the difference between permission and uses-permission in Android?

What is difference between permission and uses-permission in Android? permission is normally used when making a custom permission e.g. when making an app that other apps can tie in to, limiting access is a must. uses-permission is used when your app actually needs a permission it doesn't have normally.

Is it safe to give app permissions?

These permissions are not inherently dangerous, but have the potential for misuse. That's why Android gives you the opportunity to accept or refuse them. Some apps need these permissions. In those cases, check that an app is safe before you install it, and make sure the app comes from a reputable developer.


1 Answers

As you say, according to the documentation, it isn't a valid attribute in a <uses-permission> tag. It goes on to say (emphasis mine):

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

I would suggest your SDK documentation might be wrong, and you should include a <uses-feature> tag for any implied features.

like image 136
Geobits Avatar answered Sep 18 '22 22:09

Geobits