(Android) Comment out accelerometer code also in event callback

This commit is contained in:
twinaphex 2012-10-21 16:51:04 +02:00
parent f6e46ce8a4
commit 3ec51cbd23

View File

@ -54,6 +54,7 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd)
break;
case APP_CMD_GAINED_FOCUS:
// When our app gains focus, we start monitoring the accelerometer.
/*
if (g_android.accelerometerSensor != NULL)
{
ASensorEventQueue_enableSensor(g_android.sensorEventQueue,
@ -63,15 +64,18 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd)
ASensorEventQueue_setEventRate(g_android.sensorEventQueue,
g_android.accelerometerSensor, (1000L/60)*1000);
}
*/
break;
case APP_CMD_LOST_FOCUS:
// When our app loses focus, we stop monitoring the accelerometer.
// This is to avoid consuming battery while not being used.
if (!g_android.window_inited)
{
/*
if (g_android.accelerometerSensor != NULL)
ASensorEventQueue_disableSensor(g_android.sensorEventQueue,
g_android.accelerometerSensor);
*/
// Also stop animating.
g_android.animating = 0;