Skip to content

Explain the app's data access from the system Privacy Dashboard - #7549

Open
hayaksi1 wants to merge 6 commits into
element-hq:developfrom
hayaksi1:fix/943-permission-rationale
Open

Explain the app's data access from the system Privacy Dashboard#7549
hayaksi1 wants to merge 6 commits into
element-hq:developfrom
hayaksi1:fix/943-permission-rationale

Conversation

@hayaksi1

Copy link
Copy Markdown
Contributor

Content

Since Android 12 the system Privacy Dashboard offers a "See why this app accessed your data" link for
any app that declares an activity for android.intent.action.VIEW_PERMISSION_USAGE. Element declares
none, so the link is simply absent.

This adds one. It is a static screen listing the four runtime permissions the application asks for —
camera, microphone, location, notifications — with the feature each one serves. It holds no state,
reads nothing, and is guarded by android:permission="android.permission.START_VIEW_PERMISSION_USAGE"
so only the permission controller can start it.

The wording sticks to what the code actually does today, so it needs revisiting if a permission is
added or repurposed. aapt dump badging is unchanged, since the new activity is not launchable and
adds no uses-permission.

Motivation and context

Part of #943.

Screenshots / GIFs

The screen is covered by a @PreviewsDayNight preview, so it appears in the file diff. Note that
:tests:uitests deliberately excludes :app, so there is no Paparazzi golden for it.

Tests

  • app/src/test/.../permissions/PermissionRationaleActivityTest.kt — asserts the activity stays
    declared, keeps answering VIEW_PERMISSION_USAGE, and keeps its START_VIEW_PERMISSION_USAGE
    guard. The entry point is a manifest declaration and nothing in the code would notice if it were
    dropped or exported unguarded, so that is what the test watches.
    A queryIntentActivities test would be the natural form, but Robolectric in :app resolves against
    org.robolectric.default rather than the merged manifest — :app does not set
    unitTests.isIncludeAndroidResources, which is also why :tests:uitests cannot depend on it.
  • ./gradlew :app:testGplayDebugUnitTest :app:compileGplayDebugKotlin :app:ktlintCheck :app:detekt — green.

Tested devices

  • Physical
  • Emulator
  • OS version(s): the screen itself renders from API 24; the Privacy Dashboard entry point needs API 31+

Checklist

  • I am aware of the etiquette.
  • This PR was made with the help of AI:
    • Yes. In this case, please request a review by Copilot.
    • No.
  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly defines what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

Android 12 lets an app answer the Privacy Dashboard's "See why this app
accessed your data" entry with its own screen. Element declared no such
activity, so the entry did not appear at all.

Add one that lists the four runtime permissions the app asks for —
camera, microphone, location and notifications — with the feature each
one serves. It is guarded by START_VIEW_PERMISSION_USAGE, so only the
permission controller can start it, and it does nothing but display text.

Part of element-hq#943.
@hayaksi1
hayaksi1 requested a review from a team as a code owner August 25, 2026 14:00
@hayaksi1
hayaksi1 requested review from bmarty and removed request for a team August 25, 2026 14:00
@github-actions github-actions Bot added the Z-Community-PR Issue is solved by a community member's PR label Aug 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:

  • If your pull request adds a feature or modifies the UI, this should have an equivalent pull request in the Element X iOS repo unless it only affects an Android-only behaviour or is behind a disabled feature flag, since we need parity in both clients to consider a feature done. It will also need to be approved by our product and design teams before being merged, so it's usually a good idea to discuss the changes in a Github issue first and then start working on them once the approach has been validated.
  • Your branch should be based on origin/develop, at least when it was created.
  • The title of the PR will be used for release notes, so it needs to describe the change visible to the user.
  • The test pass locally running ./gradlew test.
  • The code quality check suite pass locally running ./gradlew runQualityChecks.
  • If you modified anything related to the UI, including previews, you'll have to run the Record screenshots GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, it will prevent the CI from running temporarily, until you upload a new commit after that one. To do so, just pull the latest changes and push an empty commit.

@bmarty

bmarty commented Aug 25, 2026

Copy link
Copy Markdown
Member

Thanks @hayaksi1 . Can you add a screenshot of the screen to the PR description or in a comment so that I can ask product what they think about it?

hayaksi1 and others added 2 commits August 25, 2026 18:08
The screen lived in :app, which :tests:uitests deliberately excludes, so
ComposablePreviewScanner never saw its @PreviewsDayNight preview and the
change shipped without a Paparazzi golden.

Move the composable next to PermissionsView in libraries/permissions/api
and its strings into libraries/ui-strings, leaving the activity in :app as
the manifest entry point. The preview is now recorded like every other
screen.
@CLAassistant

CLAassistant commented Aug 25, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@hayaksi1

Copy link
Copy Markdown
Contributor Author

@bmarty Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants