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 - Android : enabling android sensor upon SDL_INIT_SENSOR
Summary: Android : enabling android sensor upon SDL_INIT_SENSOR
Status: RESOLVED LATER
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: don't know
Hardware: All All
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-09 13:11 UTC by Sylvain
Modified: 2018-10-10 00:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.