Comments (7)
@j13u11fr09 @xyzz
This is related to this 3497b81 specific commit which was pushed to the latest stable release published on Google Play Store recently.
SDL 2.0.14 in its HIDDeviceUSB.java particularly in one of the latest commits (libsdl-org/SDL@eea450b) addresses this issue by implementing exception handling in the getSerialNumber() method so that the app wouldn't crash, but I suppose requesting permission is up to app's developer himself.
Here is an error log I get on my MIUI 12 Android 10 device when I connect either mouse or Dualshock 3:
java.lang.RuntimeException: Unable to start activity ComponentInfo{is.xyz.omw/ui.activity.GameActivity}: java.lang.SecurityException: User has not given 10249/is.xyz.omw permission to access device /dev/bus/usb/001/002 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3312) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3461) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2048) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:227) at android.app.ActivityThread.main(ActivityThread.java:7582) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:953) Caused by: java.lang.SecurityException: User has not given 10249/is.xyz.omw permission to access device /dev/bus/usb/001/002 at android.os.Parcel.createException(Parcel.java:2074) at android.os.Parcel.readException(Parcel.java:2042) at android.os.Parcel.readException(Parcel.java:1990) at android.hardware.usb.IUsbSerialReader$Stub$Proxy.getSerial(IUsbSerialReader.java:123) at android.hardware.usb.UsbDevice.getSerialNumber(UsbDevice.java:143)at org.libsdl.app.HIDDeviceUSB.getSerialNumber(HIDDeviceUSB.java:56)
at org.libsdl.app.HIDDeviceManager.connectHIDDeviceUSB(HIDDeviceManager.java:362) at org.libsdl.app.HIDDeviceManager.handleUsbDeviceAttached(HIDDeviceManager.java:324) at org.libsdl.app.HIDDeviceManager.initializeUSB(HIDDeviceManager.java:228) at org.libsdl.app.HIDDeviceManager.(HIDDeviceManager.java:152) at org.libsdl.app.HIDDeviceManager.acquire(HIDDeviceManager.java:36) at org.libsdl.app.SDLActivity.onCreate(SDLActivity.java:252) at ui.activity.GameActivity.onCreate(GameActivity.kt:106) at android.app.Activity.performCreate(Activity.java:7893) at android.app.Activity.performCreate(Activity.java:7880) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3287) ... 11 more Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.usb.UsbUserSettingsManager.checkPermission(UsbUserSettingsManager.java:177) at com.android.server.usb.UsbSerialReader.getSerial(UsbSerialReader.java:96) at android.hardware.usb.IUsbSerialReader$Stub.onTransact(IUsbSerialReader.java:84) at android.os.Binder.execTransactInternal(Binder.java:1021) at android.os.Binder.execTransact(Binder.java:994)
from openmw-android.
Okay I've applied this patch (it doesn't seem the serial number is actually used anywhere), once this build completes - https://github.com/xyzz/openmw-android/actions/runs/610780501 - could you please confirm whether it fixes the problem.
from openmw-android.
Oh, suddenly it just works without any permission requests on my end! Both for dualshock 3 and keyboard/mouse combo through usb hub.
Hopefully this resolves issue for @j13u11fr09, though removing the logging itself as in next libsdl-org/SDL@68e1731 commit might be a good idea to improve performance since SDL developers themselves don't consider it useful at all.
from openmw-android.
I installed the omw-debug-b2a6ae7-arm64 version linked above and the usb device now works correctly: openmw doesn't crash. This fixed the problem.
from openmw-android.
Related to https://www.xda-developers.com/android-11-trouble-getting-games-recognize-their-controllers/ ?
from openmw-android.
No, the controller works fine otherwise. As stated, the controller works in the stable build of OpenMW. Only crashes there nightly build of OpenMW.
from openmw-android.
Did a little bit of digging, installing older versions of the nightly (0.47.0) build: the issue starts at version 0.47.0-40. I'm able to use version 0.47.0-39 with the controller just fine.
from openmw-android.
Related Issues (20)
- Missing texture?
- How to build gl4es as a static
- ESM Error HOT 1
- Crash on play and when selecting game directory on Android 11
- Gamma not changeable on GLESv1 HOT 2
- NDK version update
- Touchscreen Left Joystick bug HOT 1
- Control Layout Skin
- SD card not detected HOT 7
- Fatal Error: Vector
- Camera bug since Android 11 HOT 4
- Some notes before updating OpenMW HOT 10
- NDK21 - game journal crashes. HOT 3
- Profiler white text becomes black HOT 1
- Play Store - OMW Stable "Incompatible with device" HOT 2
- NDK r22b is out HOT 2
- Dependency update request for performance improvements
- Touch controls have had issues for a couple of months now on android HOT 1
- UI Scaling Factor Not Accurate
- Android 11 Joysticks Are Connected to Auto UI Scaling HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openmw-android.