Skip to content

fix(android): run hardware acceleration on UI thread#854

Closed
fadi-george wants to merge 1 commit intomainfrom
fix/android-hardware-accel-thread
Closed

fix(android): run hardware acceleration on UI thread#854
fadi-george wants to merge 1 commit intomainfrom
fix/android-hardware-accel-thread

Conversation

@fadi-george
Copy link
Collaborator

@fadi-george fadi-george commented Mar 6, 2026

Summary

The _enableHardwareAcceleration method was calling window.setFlags() from the Unity main thread, but this is an Android UI operation that must run on the Android UI thread. This caused a CalledFromWrongThreadException which broke SDK initialization, preventing push ID, app ID, and other data from loading.

Wraps the setFlags call in runOnUiThread to run on the correct thread.

Test plan

  • Build and run the demo app on Android
  • Verify no CalledFromWrongThreadException in logcat
  • Verify push ID, app ID, and user data load correctly on startup
  • Verify IAM transparency still works (the original purpose of the hardware acceleration flag)

Made with Cursor


This change is Reviewable

@fadi-george fadi-george closed this Mar 6, 2026
@fadi-george fadi-george deleted the fix/android-hardware-accel-thread branch March 6, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant