InputCommon: Add Android InputBackend class.

This commit is contained in:
Jordan Woyak
2024-03-11 02:36:07 -05:00
parent 8583b6751a
commit a9a9fdd9e9
3 changed files with 28 additions and 19 deletions

View File

@ -71,7 +71,7 @@ void ControllerInterface::Initialize(const WindowSystemInfo& wsi)
m_input_backends.emplace_back(ciface::SDL::CreateInputBackend(this));
#endif
#ifdef CIFACE_USE_ANDROID
ciface::Android::Init();
m_input_backends.emplace_back(ciface::Android::CreateInputBackend(this));
#endif
#ifdef CIFACE_USE_EVDEV
m_input_backends.emplace_back(ciface::evdev::CreateInputBackend(this));
@ -157,10 +157,6 @@ void ControllerInterface::RefreshDevices(RefreshReason reason)
// do it async, to not risk the emulated controllers default config loading not finding a default
// device.
#ifdef CIFACE_USE_ANDROID
ciface::Android::PopulateDevices();
#endif
for (auto& backend : m_input_backends)
backend->PopulateDevices();
@ -199,10 +195,6 @@ void ControllerInterface::Shutdown()
// Update control references so shared_ptr<Device>s are freed up BEFORE we shutdown the backends.
ClearDevices();
#ifdef CIFACE_USE_ANDROID
ciface::Android::Shutdown();
#endif
// Empty the container of input backends to deconstruct and deinitialize them.
m_input_backends.clear();