Explain the app's data access from the system Privacy Dashboard - #7549
Open
hayaksi1 wants to merge 6 commits into
Open
Explain the app's data access from the system Privacy Dashboard#7549hayaksi1 wants to merge 6 commits into
hayaksi1 wants to merge 6 commits into
Conversation
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.
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:
|
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? |
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.
Contributor
Author
|
@bmarty Done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 declaresnone, 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 badgingis unchanged, since the new activity is not launchable andadds no
uses-permission.Motivation and context
Part of #943.
Screenshots / GIFs
The screen is covered by a
@PreviewsDayNightpreview, so it appears in the file diff. Note that:tests:uitestsdeliberately excludes:app, so there is no Paparazzi golden for it.Tests
app/src/test/.../permissions/PermissionRationaleActivityTest.kt— asserts the activity staysdeclared, keeps answering
VIEW_PERMISSION_USAGE, and keeps itsSTART_VIEW_PERMISSION_USAGEguard. 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
queryIntentActivitiestest would be the natural form, but Robolectric in:appresolves againstorg.robolectric.defaultrather than the merged manifest —:appdoes not setunitTests.isIncludeAndroidResources, which is also why:tests:uitestscannot depend on it../gradlew :app:testGplayDebugUnitTest :app:compileGplayDebugKotlin :app:ktlintCheck :app:detekt— green.Tested devices
Checklist