open-ecosystem-development / OpenXR-SDK

Apache License 2.0
2 stars 3 forks source link

The com.huawei.usblib.VisionGlass class not compatible with Android 14 or higher (U+) #56

Open javifernandez opened 5 months ago

javifernandez commented 5 months ago

Registering receivers with intention using the RECEIVER_EXPORTED / RECEIVER_NOT_EXPORTED flag was introduced as part of Android 13 and is now a requirement for apps running on Android 14 or higher (U+).

If you do not implement this, the system will throw a security exception.

The VisionGlass class from the com.huawei.usblib component seems to call to the registerReceiver method without the required flag, which is mandatory since Android 14.

27692-27692 AndroidRuntime           E  FATAL EXCEPTION: main
                                        Process: com.igalia.wolvic.visionglass.dev, PID: 27692
                                        java.lang.RuntimeException: Unable to start activity ComponentInfo{com.igalia.wolvic.visionglass.dev/com.igalia.wolvic.VRBrowserActivity}: java.lang.SecurityException: com.igalia.wolvic.visionglass.dev: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
                                            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4164)
                                            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322)
                                            at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
                                            at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
                                            at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
                                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685)
                                            at android.os.Handler.dispatchMessage(Handler.java:106)
                                            at android.os.Looper.loopOnce(Looper.java:230)
                                            at android.os.Looper.loop(Looper.java:319)
                                            at android.app.ActivityThread.main(ActivityThread.java:8919)
                                            at java.lang.reflect.Method.invoke(Native Method)
                                            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
                                        Caused by: java.lang.SecurityException: com.igalia.wolvic.visionglass.dev: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
                                            at android.os.Parcel.createExceptionOrNull(Parcel.java:3069)
                                            at android.os.Parcel.createException(Parcel.java:3053)
                                            at android.os.Parcel.readException(Parcel.java:3036)
                                            at android.os.Parcel.readException(Parcel.java:2978)
                                            at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6157)
                                            at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1913)
                                            at android.app.ContextImpl.registerReceiver(ContextImpl.java:1853)
                                            at android.app.ContextImpl.registerReceiver(ContextImpl.java:1841)
                                            at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:772)
                                            at com.huawei.usblib.h.f(Unknown Source:30)
                                            at com.huawei.usblib.h.<init>(Unknown Source:40)
                                            at com.huawei.usblib.n.b(Unknown Source:7)
                                            at com.huawei.usblib.n.a(Unknown Source:6)
                                            at com.huawei.usblib.VisionGlass.init(Unknown Source:0)
                                            at com.igalia.wolvic.PlatformActivity.onCreate(PlatformActivity.java:168)
                                            at com.igalia.wolvic.VRBrowserActivity.onCreate(VRBrowserActivity.java:335)
                                            at android.app.Activity.performCreate(Activity.java:8975)
                                            at android.app.Activity.performCreate(Activity.java:8944)
                                            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456)
                                            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4146)
                                            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4322) 
                                            at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103) 
                                            at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139) 
                                            at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96) 
                                            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685) 
                                            at android.os.Handler.dispatchMessage(Handler.java:106) 
                                            at android.os.Looper.loopOnce(Looper.java:230) 
                                            at android.os.Looper.loop(Looper.java:319) 
                                            at android.app.ActivityThread.main(ActivityThread.java:8919) 
                                            at java.lang.reflect.Method.invoke(Native Method) 
                                            at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) 
                                            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) 
                                        Caused by: android.os.RemoteException: Remote stack trace:
                                            at com.android.server.am.ActivityManagerService.registerReceiverWithFeature(ActivityManagerService.java:16680)
                                            at android.app.IActivityManager$Stub.onTransact$registerReceiverWithFeature$(IActivityManager.java:11613)
                                            at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:2961)
                                            at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3199)
                                            at android.os.Binder.execTransactInternal(Binder.java:1375)