Reputation: 8016
I made the location permissions optional by having :
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
But when I down the app from the Google Play store it still shows Location permission in the dialog:
What am I missing to make the permission optional ?
Thanks!
Upvotes: 1
Views: 486
Reputation: 5892
You are mixing permissions with device features. The device feature tag tells the store which devices can download a certain app because they have the correct hardware. Imagine your app has no sense in a device without GPS, they shouldn't download it. That is the meaning of the optional on device features.
In Android all the permissions you declare in the manifest will be presented in the Play Store. This is because the word Optional has no sense at all for the android permissions, at least until Android M.
When you declare a permission for your app you are just saying that your app can access to a resource. It doesn't matter if you are doing it so or the user will use it, but in the moment you have the permission declared, it will be presented to the user.
In Android M (the next major release) some permissions can be revoked by the user, so the apps have to check if they have enough permissions to execute some actions, but still, they will be shown on this Play store dialog.
Upvotes: 3