In android Manifest how do you declare that a permission is not required?

Viewed 257

Say I have these permissions:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission
    android:name="android.permission.PACKAGE_USAGE_STATS"
    tools:ignore="ProtectedPermissions" />

I would like to tell the Play Store that these permissions are not required and are not to be used for filtering out devices. I found that with some permissions like bluetooth you can add the <uses-feature tag and then to that add android:required="false". For example:

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

<!-- Tells the Play Store that the above two permissions are not required -->
<uses-feature
    android:name="android.hardware.bluetooth"
    android:required="false" />

However I found no features to declare for any of the permissions I listed in the beginning of this post. So how am I supposed to tell the Play Store that they're not required?

2 Answers

I would like to tell the Play Store that these permissions are not required and are not to be used for filtering out devices.

Don't worry! If your next update/package don't require some permissions, just remove those permissions from the mainfest.xml, and done. If you still have doubt, you can see the number of compitable device models during creation of release in your console.

I found that with some permissions like bluetooth you can add the <uses-feature tag and then to that add android:required="false".

They are all for feature-based filtering and not for permissions. Because, features might be critical for some apps to work. If an app uses a feature which is not critical for its functionality, required=false might be helpful.

So how am I supposed to tell the Play Store that they're not required?

You don't. No devices will be filtered out based on those permissions.

I would like to tell the Play Store that these permissions are not required and are not to be used for filtering out devices

No permissions are used directly for filtering out devices. As you noted, some permissions imply features, and you can declare that the features are not required.

Related