Merge pull request #1323 from Sonicadvance1/Android-crash

Fix a crash on Android when unplugging a controller during emulation.
This commit is contained in:
Ryan Houdek 2014-10-19 08:48:52 -05:00
commit 939fa492c8
1 changed files with 4 additions and 0 deletions

View File

@ -313,6 +313,10 @@ public final class EmulationActivity extends Activity
return super.dispatchGenericMotionEvent(event);
}
// Don't attempt to do anything if we are disconnecting a device.
if (event.getActionMasked() == MotionEvent.ACTION_CANCEL)
return true;
InputDevice input = event.getDevice();
List<InputDevice.MotionRange> motions = input.getMotionRanges();