Skip to content

Allow passing a proper activity pointer to the android loader#219

Merged
Ralith merged 2 commits into
Ralith:masterfrom
MaximilianHausen:android-loader-init-activity
Jun 4, 2026
Merged

Allow passing a proper activity pointer to the android loader#219
Ralith merged 2 commits into
Ralith:masterfrom
MaximilianHausen:android-loader-init-activity

Conversation

@MaximilianHausen

Copy link
Copy Markdown
Contributor

Extends the PlatformInfo trait introduced in #217 to also handle android loader initialization.

Previously, only create_instance used the user-provided activity pointer from AndroidPlatformInfo, while initialize_android_loader still relied on ndk_context. That should actually work based on the spec (XR_KHR_loader_init_android just requires any android.content.Context), but it wasn't enough when testing android-activity 0.6.1 on my quest 3.

I decided against storing the PlatformInfo from the constructors in Entry because that would make Entry !Sync by default and I am not 100% sure if implementing it manually would be correct here. Keeping it like this is also more flexible because it allows users to pass different pointers to init_loader and create_instance (I don't see when that would be neccessary, but it could be useful for debugging).

Extends 613af27 to also use the provided activity pointer for loader initialization. This was necessary to get android-activity 0.6.1 running on my quest 3.
@MaximilianHausen MaximilianHausen changed the title Android loader init activity Allow passing a proper activity pointer to the android loader Jun 3, 2026

@Ralith Ralith left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think this makes sense. It'd be nice to have better ergonomics by saving the data, but if it were that easy I assume OpenXR would do so itself, so probably good to respect the underlying pattern here.

@Ralith Ralith enabled auto-merge (rebase) June 4, 2026 06:02
@Ralith Ralith merged commit beaeb9b into Ralith:master Jun 4, 2026
6 checks passed
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.

2 participants