Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VisionGlass] Create the GestureManager from an UI context #1711

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

svillar
Copy link
Member

@svillar svillar commented Jan 22, 2025

In order to initialize properly the GestureManager object it must be created with an UI context, like for example an Activity. Use the Wolvic's main activity to initialize it.

This was found by StrictMode. It was throwing the following exception:

Tried to access the API:GestureDetector#init which needs to have proper configuration from a non-UI Context:com.igalia.wolvic.VRBrowserApplication@ff7c8aa The API:GestureDetector#init needs a proper configuration. Use UI contexts such as an activity or a context created via createWindowContext(Display, int, Bundle) or createConfigurationContext(Configuration) with a proper configuration.

java.lang.IllegalAccessException: Tried to access the API:GestureDetector#init which needs to have proper configuration from a non-UI Context:com.igalia.wolvic.VRBrowserApplication@ff7c8aa
at android.os.StrictMode.assertConfigurationContext(StrictMode.java:2297)
at android.view.GestureDetector.init(GestureDetector.java:480)
at android.view.GestureDetector.(GestureDetector.java:440)
at android.view.GestureDetector.(GestureDetector.java:408)
at com.igalia.wolvic.PlatformActivity$PlatformActivityPluginVisionGlass.setupPhoneUI(PlatformActivity.java:654)
at com.igalia.wolvic.PlatformActivity$PlatformActivityPluginVisionGlass.(PlatformActivity.java:541)
at com.igalia.wolvic.PlatformActivity.createPlatformPlugin(PlatformActivity.java:531)
at com.igalia.wolvic.VRBrowserActivity.initializeWidgets(VRBrowserActivity.java:477)
at com.igalia.wolvic.VRBrowserActivity.onCreate(VRBrowserActivity.java:362)

In order to initialize properly the GestureManager object it must be
created with an UI context, like for example an Activity. Use the Wolvic's
main activity to initialize it.

This was found by StrictMode. It was throwing the following exception:

Tried to access the API:GestureDetector#init which needs to have proper
configuration from a non-UI Context:com.igalia.wolvic.VRBrowserApplication@ff7c8aa
The API:GestureDetector#init needs a proper configuration. Use UI contexts such
as an activity or a context created via createWindowContext(Display, int, Bundle)
or  createConfigurationContext(Configuration) with a proper configuration.

java.lang.IllegalAccessException: Tried to access the API:GestureDetector#init which needs to have proper configuration from a non-UI Context:com.igalia.wolvic.VRBrowserApplication@ff7c8aa
      	at android.os.StrictMode.assertConfigurationContext(StrictMode.java:2297)
      	at android.view.GestureDetector.init(GestureDetector.java:480)
  	at android.view.GestureDetector.<init>(GestureDetector.java:440)
     	at android.view.GestureDetector.<init>(GestureDetector.java:408)
      	at com.igalia.wolvic.PlatformActivity$PlatformActivityPluginVisionGlass.setupPhoneUI(PlatformActivity.java:654)
   	at com.igalia.wolvic.PlatformActivity$PlatformActivityPluginVisionGlass.<init>(PlatformActivity.java:541)
   	at com.igalia.wolvic.PlatformActivity.createPlatformPlugin(PlatformActivity.java:531)
      	at com.igalia.wolvic.VRBrowserActivity.initializeWidgets(VRBrowserActivity.java:477)
       	at com.igalia.wolvic.VRBrowserActivity.onCreate(VRBrowserActivity.java:362)
@svillar svillar added the release_candidate PR that should be part of the next release label Jan 22, 2025
Copy link
Collaborator

@felipeerias felipeerias left a comment

Choose a reason for hiding this comment

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

LGTM.

@felipeerias felipeerias merged commit 7693872 into main Jan 23, 2025
22 checks passed
@felipeerias felipeerias deleted the ui_context_visionglass branch January 23, 2025 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_candidate PR that should be part of the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants