Android Uses-Feature VS. Uses-Permision Optimization

1.7k views Asked by At

I have the following permissions explicitly requested in my manifest.

I would like to optimize store visibility by switching as many as possible of them to implicit 'uses-feature' declarations. I will also handle this additionally in code checking for features before I access them.

Internet access is the only thing that's truly required for my app, other features I can enable/disable conditionally based on hasFeatures().

Question: Which of these permissions can I change?

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="com.android.vending.BILLING" />
<permission android:name="com.appName.supportmapfragment.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.appName.supportmapfragment.permission.MAPS_RECEIVE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"  />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
1

There are 1 answers

0
BSMP On

Set required to 'false' if your app doesn't require something to run:

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.

http://developer.android.com/guide/topics/manifest/uses-permission-element.html (in the right-hand sidebar)

The documentation has this example:

<uses-feature android:name="android.hardware.camera" android:required="false" />