RUM-6218: Add privacy override for hidden views
What does this PR do?
Sets up the common mechanism for privacy overrides and implements overriding view privacy to hidden in the hierarchy.
Views will be able to set hidden override privacy using the api:
[view].setSessionReplayHidden(hide = true/false)
where true will register the view to be replaced with a placeholder with the label "Hidden", and false will remove the hidden override from the view. The children of hidden views will not be traversed.
Motivation
This is part of the third stage of Fine Grained Masking. The first stage was the start/stop api, and the second was global fine grained masking levels for the app.
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)
- [ ] Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
- [ ] Make sure you discussed the feature or bugfix with the maintaining team in an Issue
- [ ] Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
Codecov Report
Attention: Patch coverage is 86.20690% with 4 lines in your changes missing coverage. Please review.
Project coverage is 70.33%. Comparing base (
4cc5caf) to head (f16a5d4). Report is 12 commits behind head on develop.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...ssionreplay/internal/recorder/TreeViewTraversal.kt | 42.86% | 3 Missing and 1 partial :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## develop #2291 +/- ##
===========================================
+ Coverage 70.31% 70.33% +0.02%
===========================================
Files 736 738 +2
Lines 27456 27493 +37
Branches 4606 4610 +4
===========================================
+ Hits 19305 19337 +32
- Misses 6862 6873 +11
+ Partials 1289 1283 -6
| Files with missing lines | Coverage Δ | |
|---|---|---|
| ...android/sessionreplay/PrivacyOverrideExtensions.kt | 100.00% <100.00%> (ø) |
|
| ...nreplay/internal/recorder/SessionReplayRecorder.kt | 96.99% <100.00%> (+0.07%) |
:arrow_up: |
| ...eplay/internal/recorder/mapper/HiddenViewMapper.kt | 100.00% <100.00%> (ø) |
|
| ...ssionreplay/internal/recorder/TreeViewTraversal.kt | 89.47% <42.86%> (-6.60%) |
:arrow_down: |