Search code examples
androidandroid-permissions

How to add the "about" button in permissions for an Android app?


I recently downloaded the Fitbit app and wanted to give it all permissions. I noticed that each permission has an "About" button that redirects users to a website about the permission. I've added an activity that shows the permissions from my app, and I'd like to add this same "About" button feature. How can I do this?enter image description here

I want to add this feature into my app, how can I do it?

The “Permissions” page of my app currently has this layout, particularly in the “About” section. The PermissionsActivity is a separate activity that I intend to connect with the “About” buttons.

enter image description here


Solution

  • It's the Privacy dashboard:

    https://developer.android.com/training/permissions/explaining-access#privacy-dashboard

    Decide what your data access rationale activity should show. For example, you might show your app's website or a help center article. To provide a more detailed explanation about the types of data that your app accesses, as well as when the access occurred, handle the extras that the system includes when it invokes the permission usage intent:

    Define your PermissionsActivity with intent-filter as stated in the document to show when users tap on the (!) button on the App's permissions page or from the Permission usage page:

    <activity android:name=".PermissionsActivity"
              android:permission="android.permission.START_VIEW_PERMISSION_USAGE"
              android:exported="true">
           <!-- VIEW_PERMISSION_USAGE shows a selectable information icon on
                your app permission's page in system settings.
                VIEW_PERMISSION_USAGE_FOR_PERIOD shows a selectable information
                icon on the Privacy Dashboard screen. -->
        <intent-filter>
           <action android:name="android.intent.action.VIEW_PERMISSION_USAGE" />
           <action android:name="android.intent.action.VIEW_PERMISSION_USAGE_FOR_PERIOD" />
           <category android:name="android.intent.category.DEFAULT" />
           ...
        </intent-filter>
    </activity>
    

    Useful post here: https://yggr.medium.com/exploring-android-12-data-access-rationale-f0e713e87f96