Skip to content

Commit aac1322

Browse files
fix: tweaks Android InteractionDetector to delegate additional defaul… (#294)
<!-- CURSOR_SUMMARY --> > [!NOTE] > `InteractionDetector` now forwards `onProvideKeyboardShortcuts` and `onPointerCaptureChanged` to the original `Window.Callback` while still intercepting touch events. > > - **Android — `InteractionSource`**: > - **`InteractionDetector`**: > - Delegates `onProvideKeyboardShortcuts(...)` to the original `Window.Callback`. > - Delegates `onPointerCaptureChanged(...)` (API 26+) to the original `Window.Callback`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ecd7671. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Agustin Grognetti <[email protected]>
1 parent 0d18ebe commit aac1322

File tree

1 file changed

+15
-0
lines changed
  • sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/replay

1 file changed

+15
-0
lines changed

sdk/@launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/replay/InteractionSource.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import android.app.Activity
44
import android.app.Application
55
import android.os.Bundle
66
import android.os.SystemClock
7+
import android.view.KeyboardShortcutGroup
8+
import android.view.Menu
79
import android.view.MotionEvent
810
import android.view.Window
911
import io.opentelemetry.android.session.SessionManager
@@ -46,6 +48,19 @@ class InteractionSource(
4648
onInteraction(window, event)
4749
return originalCallback.dispatchTouchEvent(event)
4850
}
51+
52+
override fun onProvideKeyboardShortcuts(
53+
data: MutableList<KeyboardShortcutGroup>?,
54+
menu: Menu?,
55+
deviceId: Int
56+
) {
57+
originalCallback.onProvideKeyboardShortcuts(data, menu, deviceId)
58+
}
59+
60+
@RequiresApi(Build.VERSION_CODES.O)
61+
override fun onPointerCaptureChanged(hasCapture: Boolean) {
62+
originalCallback.onPointerCaptureChanged(hasCapture)
63+
}
4964
}
5065

5166
// This method will be invoked by any / all interceptors that receive interactions. This is

0 commit comments

Comments
 (0)