Commit 11b642f
authored
feat: Android Dialog Capture (#302)
## Summary
Implement capture multiple type of windows and draw them on each other.
Some windows like Toast still not captured. Hoping in the next PRs
<img width="720" height="681" alt="image"
src="https://github.com/user-attachments/assets/25b1d33b-122f-48b2-83cc-6c09bb7fc21d"
/>
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds multi-window capture and compositing (activity + dialogs) with
per-window masking, refactors capture into `replay.capture`, and updates
instrumentation/internals accordingly.
>
> - **Capture (refactor to
`com.launchdarkly.observability.replay.capture`)**:
> - **Multi-window capture & compositing**: New
`WindowInspector`/`WindowEntry` enumerate app windows and choose a base
window; captures overlays and composites bitmaps with position offsets.
> - **CaptureSource rewrite**: Uses `PixelCopy` (with fallback to canvas
draw), synchronizes to frame, applies masking, encodes WEBP -> Base64,
and emits `CaptureEvent`.
> - Moves `CaptureEvent` to `replay.capture` package.
> - **Masking**:
> - `SensitiveAreasCollector.collectFromActivity` now collects from a
root `View` (not `Activity`), enabling per-window mask extraction.
> - **Instrumentation**:
> - `ReplayInstrumentation` integrates new `CaptureSource` API (no
Activity lifecycle attach), continues emitting media/interaction logs.
> - **Exporter/Tests**:
> - Update imports to `replay.capture.CaptureEvent`; minor
formatting/test adjustments.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d07327d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 9e65784 commit 11b642f
File tree
9 files changed
+484
-244
lines changed- sdk/@launchdarkly/observability-android/lib/src
- main/kotlin/com/launchdarkly/observability/replay
- capture
- masking
- test/kotlin/com/launchdarkly/observability/replay
9 files changed
+484
-244
lines changedLines changed: 0 additions & 232 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
82 | | - | |
| 83 | + | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
130 | | - | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
0 commit comments