EmiyaSyahriel / tuiodroid

Forked from https://github.com/TobiasSchwirten/tuiodroid
GNU General Public License v3.0
1 stars 0 forks source link

Needs HIGH_SAMPLING_RATE_SENSORS #1

Closed EchterAgo closed 1 week ago

EchterAgo commented 1 month ago

On a Pixel 8 Pro:

03-26 23:02:44.943 26992 26992 D AndroidRuntime: Shutting down VM
03-26 23:02:44.944 26992 26992 E AndroidRuntime: FATAL EXCEPTION: main
03-26 23:02:44.944 26992 26992 E AndroidRuntime: Process: tuioDroid.impl, PID: 26992
03-26 23:02:44.944 26992 26992 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity {tuioDroid.impl/tuioDroid.impl.MainActivity}: java.lang.SecurityException: To use the sampling rate of 0 microseconds, app needs to declare the normal permission HIGH_SAMPLING_RATE_SENSORS.
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5176)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5209)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:60)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeLifecycleItem(TransactionExecutor.java:254)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:228)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:91)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2544)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:107)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:232)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:317)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:8501)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
03-26 23:02:44.944 26992 26992 E AndroidRuntime: Caused by: java.lang.SecurityException: To use the sampling rate of 0 microseconds, app needs to declare the normal permission HIGH_SAMPLING_RATE_SENSORS.
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.hardware.SystemSensorManager$BaseEventQueue.enableSensor(SystemSensorManager.java:963)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.hardware.SystemSensorManager$BaseEventQueue.addSensor(SystemSensorManager.java:883)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.hardware.SystemSensorManager.registerListenerImpl(SystemSensorManager.java:278)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.hardware.SensorManager.registerListener(SensorManager.java:858)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.hardware.SensorManager.registerListener(SensorManager.java:765)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at tuioDroid.impl.MainActivity.onResume(MainActivity.java:235)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1666)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.app.Activity.performResume(Activity.java:8915)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5166)
03-26 23:02:44.944 26992 26992 E AndroidRuntime:        ... 14 more
EmiyaSyahriel commented 1 month ago

@EchterAgo . This should've been fixed in 1.2.1-emsy release, can you please check it? I cannot check it by myself because my phone (Nokia X30 5G) does not enforce this permission.

EchterAgo commented 1 week ago

Fixed, thanks!