diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-10-18 07:33:51 -0500 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2014-10-18 07:33:51 -0500 |
| commit | ceb08acf234dde3b3dc30bae2142db3464dd3e8e (patch) | |
| tree | 5eac4d206154af763ee1e3dc6a9b83f9bba74189 /Source/Android/src | |
| parent | 742f9c6b14348b7279cb6b666a342fb2fcf4792c (diff) | |
Fix a crash on Android when unplugging a controller during emulation.
If the action we are getting is a ACTION_CANCEL, it means that the "gesture" is aborted and we shouldn't perform any more actions on it.
Diffstat (limited to 'Source/Android/src')
| -rw-r--r-- | Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java index cd01979afa..fb96bec559 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/emulation/EmulationActivity.java @@ -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(); |
