From 30de6d6f571e1b1d3873179317ec22b6f6ca6e9a Mon Sep 17 00:00:00 2001 From: maxwell Date: Wed, 15 Oct 2025 22:27:02 -0400 Subject: [PATCH 1/2] Add annotation overlay feature for remote desktop - Implement AnnotationOverlayService for system-wide overlay - Add AnnotationBridge for server message handling - Support freehand drawing, shapes (rect/circle/arrow), and TTL - Handle overlay permissions and user consent - Send lifecycle events (started/stopped) to server - Integrate with existing remote desktop tunnels Core components: - AnnotationServiceBus: Command routing and lifecycle management - DrawingOverlayView: Canvas rendering with hardware acceleration - AnnotationConsent: User permission flow with auto-enable option - AnnotationController: Service lifecycle and permission management Features: - Real-time stroke drawing with smooth path rendering - Geometric shapes: rectangles, circles, arrows - TTL support for temporary annotations - Color and width styling from server - Pass-through overlay (non-interactive) - Foreground service with notification - Coordinate normalization for different screen sizes This enables browser users to annotate Android screens during remote desktop sessions with real-time visual feedback. --- .idea/AndroidProjectSystem.xml | 6 + .idea/deploymentTargetSelector.xml | 18 ++ .idea/deviceManager.xml | 13 + .idea/gradle.xml | 6 +- .idea/migrations.xml | 10 + .idea/misc.xml | 6 + .idea/runConfigurations.xml | 17 + app/build.gradle | 44 +-- app/src/main/AndroidManifest.xml | 11 + .../com/meshcentral/agent/MainActivity.kt | 17 +- .../java/com/meshcentral/agent/MeshAgent.kt | 41 ++- .../java/com/meshcentral/agent/MeshTunnel.kt | 153 +++++++++ .../meshcentral/agent/NotificationUtils.kt | 98 +++++- .../meshcentral/agent/ScreenCaptureService.kt | 292 ++++++++++++------ .../com/meshcentral/agent/SettingsFragment.kt | 39 ++- .../agent/annotation/AnnotationBridge.kt | 186 +++++++++++ .../agent/annotation/AnnotationConsent.kt | 71 +++++ .../agent/annotation/AnnotationController.kt | 130 ++++++++ .../agent/annotation/AnnotationFeature.kt | 29 ++ .../annotation/AnnotationOverlayService.kt | 125 ++++++++ .../agent/annotation/AnnotationPrefs.kt | 21 ++ .../agent/annotation/AnnotationServiceBus.kt | 143 +++++++++ .../agent/annotation/DrawingOverlayView.kt | 143 +++++++++ .../annotation/StopAnnotationReceiver.kt | 11 + .../com/meshcentral/agent/annotation/Types.kt | 21 ++ app/src/main/res/values/strings.xml | 6 + app/src/main/res/xml/root_preferences.xml | 15 +- build.gradle | 27 +- settings.gradle | 31 +- 29 files changed, 1555 insertions(+), 175 deletions(-) create mode 100644 .idea/AndroidProjectSystem.xml create mode 100644 .idea/deploymentTargetSelector.xml create mode 100644 .idea/deviceManager.xml create mode 100644 .idea/migrations.xml create mode 100644 .idea/runConfigurations.xml create mode 100644 app/src/main/java/com/meshcentral/agent/annotation/AnnotationBridge.kt create mode 100644 app/src/main/java/com/meshcentral/agent/annotation/AnnotationConsent.kt create mode 100644 app/src/main/java/com/meshcentral/agent/annotation/AnnotationController.kt create mode 100644 app/src/main/java/com/meshcentral/agent/annotation/AnnotationFeature.kt create mode 100644 app/src/main/java/com/meshcentral/agent/annotation/AnnotationOverlayService.kt create mode 100644 app/src/main/java/com/meshcentral/agent/annotation/AnnotationPrefs.kt create mode 100644 app/src/main/java/com/meshcentral/agent/annotation/AnnotationServiceBus.kt create mode 100644 app/src/main/java/com/meshcentral/agent/annotation/DrawingOverlayView.kt create mode 100644 app/src/main/java/com/meshcentral/agent/annotation/StopAnnotationReceiver.kt create mode 100644 app/src/main/java/com/meshcentral/agent/annotation/Types.kt diff --git a/.idea/AndroidProjectSystem.xml b/.idea/AndroidProjectSystem.xml new file mode 100644 index 0000000..4a53bee --- /dev/null +++ b/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..58ae784 --- /dev/null +++ b/.idea/deploymentTargetSelector.xml @@ -0,0 +1,18 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/deviceManager.xml b/.idea/deviceManager.xml new file mode 100644 index 0000000..91f9558 --- /dev/null +++ b/.idea/deviceManager.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index a2cc883..639c779 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,11 +4,9 @@