Closed MarcoSanz12 closed 2 months ago
I'm open minded to approve any pull request which makes sense
As an easy step you could remove this permission in your app by
<uses-permission android:name="android.permission.HIGH_SAMPLING_RATE" tools:node="remove"/>
Even with a higher rate I see
java.lang.SecurityException: To use the sampling rate of 1333 microseconds, app needs to declare the normal permission HIGH_SAMPLING_RATE_SENSORS.
The documentation tells us
Use a sampling rate lower than 200Hz for all sensors: The HIGH_SAMPLING_RATE_SENSORS permission is only required for sampling rates higher than 200Hz. By using a lower sampling rate, you can avoid the need for this permission.
With this https://github.com/hannesa2/panoramaGL/pull/322 the permission is no more needed
Hello ! I've seen the library currently requires the permission
HIGH_SAMPLING_RATE SENSORS
in API 31+ .When SensorManager registers the listener for the sensors, it uses a sampling rate of 33 microseconds and this is called at least during
plManager.startSensorialRotation()
&plManager.onResume()
.These functions call
activateAccelerometer()
,activateGyroscope()
andactivateMagnetometer()
registering the listener. I don't know If there's any way to change the sampling rate to avoid using the permission which makes publishing apps in the Play Store harder because it requires a google reviewThe listener ->
protected fun activateGyroscope(): Boolean { return sensorManager.registerListener( this, sensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE), (PLConstants.kDefaultGyroscopeInterval * 1000.0f).toInt() ) }
The error ->
java.lang.RuntimeException: Unable to resume activity {com.myapplication.app/com.myapplication.app.SampleActivity}: java.lang.SecurityException: To use the sampling rate of 33 microseconds, app needs to declare the normal permission HIGH_SAMPLING_RATE_SENSORS.
Thanks