We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4301

Summary: Android : enabling android sensor upon SDL_INIT_SENSOR
Product: SDL Reporter: Sylvain <sylvain.becker>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED LATER QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: don't know   
Hardware: All   
OS: All   

Description Sylvain 2018-10-09 13:11:43 UTC
About sensors on Android, implemented in https://hg.libsdl.org/SDL/rev/24142c5073a4 and bug #1717

Java side *always* calls: 
   
  mSurface.enableSensor(Sensor.TYPE_ACCELEROMETER, true);

And there is this comment FIXME: "Why aren't we enabling sensor input at start?"


Wouldn't it make sensor to do this only if we have initialized the sensor subsystem by doing SDL_Init(SDL_INIT_SENSOR).

e.g. to add in "SDL_ANDROID_SensorInit()" (SDL_androidsensor.c) a JNI call to allow enable/disable sensors on java side during create()/pause()/resume()/destroy()
Comment 1 Sam Lantinga 2018-10-10 00:43:27 UTC
This is needed for the accelerometer joystick, which isn't tied to the sensor subsystem. This is something we can clean up for SDL 2.1.