recording: capture touch interaction off of main thread to avoid ANRs #165
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.
💡 Motivation and Context
"main" tid=1 Native
#00 pc 0x000000000009eeb8 /apex/com.android.runtime/lib64/bionic/libc.so (fsync+8)
#1 pc 0x0000000000004700 /apex/com.android.art/lib64/libopenjdkjvm.so (JVM_Sync+20)
#2 pc 0x0000000000022404 /apex/com.android.art/lib64/libopenjdk.so (FileDescriptor_sync+40)
#3 pc 0x0000000000351e30 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144)
#4 pc 0x00000000005b9a30 /apex/com.android.art/lib64/libart.so (nterp_helper+4016)
#5 pc 0x000000000043c184 /system/framework/framework.jar (android.os.FileUtils.sync+12)
at
#7 pc 0x00000000005ba854 /apex/com.android.art/lib64/libart.so (nterp_helper+7636)
at
#9 pc 0x00000000005b99d4 /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
at
#11 pc 0x00000000005b99d4 /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
at
#13 pc 0x00000000005baecc /apex/com.android.art/lib64/libart.so (nterp_helper+9292)
at
#15 pc 0x00000000005baecc /apex/com.android.art/lib64/libart.so (nterp_helper+9292)
at
#17 pc 0x00000000005b99d4 /apex/com.android.art/lib64/libart.so (nterp_helper+3924)
at
#19 pc 0x00000000005ba7f4 /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
at
#21 pc 0x00000000005b8ab4 /apex/com.android.art/lib64/libart.so (nterp_helper+52)
at
#23 pc 0x00000000005ba7f4 /apex/com.android.art/lib64/libart.so (nterp_helper+7540)
at
#25 pc 0x00000000005baecc /apex/com.android.art/lib64/libart.so (nterp_helper+9292)
at
#27 pc 0x000000000033b3a4 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612)
#28 pc 0x0000000000339404 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgsart::ArtMethod*+772)
#29 pc 0x0000000000560f80 /apex/com.android.art/lib64/libart.so (art::JNI::CallVoidMethodV+192)
#30 pc 0x00000000000af5e8 /system/lib64/libandroid_runtime.so (_JNIEnv::CallVoidMethod+120)
#31 pc 0x0000000000119e2c /system/lib64/libandroid_runtime.so (android::NativeInputEventReceiver::consumeEvents+364)
#32 pc 0x0000000000119bec /system/lib64/libandroid_runtime.so (android::NativeInputEventReceiver::handleEvent+180)
#33 pc 0x0000000000016bb0 /system/lib64/libutils.so (android::Looper::pollInner+912)
#34 pc 0x00000000000167b8 /system/lib64/libutils.so (android::Looper::pollOnce+112)
#35 pc 0x000000000014e3ec /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce+44)
#36 pc 0x0000000000351e30 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144)
at
#38 pc 0x000000000033b680 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
#39 pc 0x000000000037cb18 /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<8>+1556)
#40 pc 0x000000000037c4f4 /apex/com.android.art/lib64/libart.so (art::Method_invoke +32)
#41 pc 0x0000000000351e30 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+144)
at
#43 pc 0x00000000005ba854 /apex/com.android.art/lib64/libart.so (nterp_helper+7636)
#44 pc 0x0000000000268b10 /system/framework/framework.jar (com.android.internal.os.ZygoteInit.main+632)
#45 pc 0x000000000033b680 /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640)
#46 pc 0x00000000004e2b58 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>+728)
#47 pc 0x000000000057abe0 /apex/com.android.art/lib64/libart.so (art::JNI::CallStaticVoidMethodV+156)
#48 pc 0x00000000000b0b28 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod+120)
#49 pc 0x00000000000bc22c /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start+948)
#50 pc 0x0000000000002580 /system/bin/app_process64 (main+1320)
#51 pc 0x00000000000489e0 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+96)
at java.io.FileDescriptor.sync (Native method)
at android.os.FileUtils.sync (FileUtils.java:256)
at android.app.SharedPreferencesImpl.writeToFile (SharedPreferencesImpl.java:807)
at android.app.SharedPreferencesImpl.access$900 (SharedPreferencesImpl.java:59)
at android.app.SharedPreferencesImpl$2.run (SharedPreferencesImpl.java:672)
at android.app.SharedPreferencesImpl.enqueueDiskWrite (SharedPreferencesImpl.java:691)
at android.app.SharedPreferencesImpl.access$100 (SharedPreferencesImpl.java:59)
at android.app.SharedPreferencesImpl$EditorImpl.commit (SharedPreferencesImpl.java:604)
at
at android.app.Activity.dispatchTouchEvent (Activity.java:4241)
at
at curtains.internal.WindowCallbackWrapper$dispatchTouchEvent$dispatch$1.invoke (WindowCallbackWrapper.kt:1)
at curtains.internal.WindowCallbackWrapper$dispatchTouchEvent$dispatch$1.invoke (WindowCallbackWrapper.kt:1)
at curtains.OnTouchEventListener$DefaultImpls.intercept (Listeners.kt:1)
at com.posthog.android.replay.PostHogReplayIntegration$onTouchEventListener$1.intercept (PostHogReplayIntegration.kt:1)
Input dispatching timed out
from google sdk console
💚 How did you test it?
📝 Checklist