mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Set idle when APP_CMD_LOST_FOCUS
This commit is contained in:
parent
008db1e21c
commit
daeb8cacaf
@ -408,14 +408,21 @@ static void engine_handle_cmd(void)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case APP_CMD_LOST_FOCUS:
|
case APP_CMD_LOST_FOCUS:
|
||||||
/* Avoid draining battery while app is not being used. */
|
{
|
||||||
if ((android_app->sensor_state_mask
|
bool boolean = true;
|
||||||
& (UINT64_C(1) << RETRO_SENSOR_ACCELEROMETER_ENABLE))
|
|
||||||
&& android_app->accelerometerSensor != NULL
|
rarch_main_ctl(RARCH_MAIN_CTL_SET_PAUSED, &boolean);
|
||||||
&& driver->input_data)
|
rarch_main_ctl(RARCH_MAIN_CTL_SET_IDLE, &boolean);
|
||||||
android_input_set_sensor_state(driver->input_data, 0,
|
|
||||||
RETRO_SENSOR_ACCELEROMETER_DISABLE,
|
/* Avoid draining battery while app is not being used. */
|
||||||
android_app->accelerometer_event_rate);
|
if ((android_app->sensor_state_mask
|
||||||
|
& (UINT64_C(1) << RETRO_SENSOR_ACCELEROMETER_ENABLE))
|
||||||
|
&& android_app->accelerometerSensor != NULL
|
||||||
|
&& driver->input_data)
|
||||||
|
android_input_set_sensor_state(driver->input_data, 0,
|
||||||
|
RETRO_SENSOR_ACCELEROMETER_DISABLE,
|
||||||
|
android_app->accelerometer_event_rate);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case APP_CMD_DESTROY:
|
case APP_CMD_DESTROY:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user