Don't check input devices on platforms that don't support it

This commit is contained in:
TwistedUmbrella 2014-01-19 21:44:57 -05:00
parent dbfa473034
commit 5b386891f3
1 changed files with 13 additions and 1 deletions

View File

@ -181,6 +181,8 @@ public class GL2JNIActivity extends Activity {
}
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
JNIdc.initControllers(new boolean[] {controllerTwoConnected, controllerThreeConnected, controllerFourConnected});
int joys[] = InputDevice.getDeviceIds();
@ -279,6 +281,9 @@ public class GL2JNIActivity extends Activity {
OuyaController.BUTTON_R1, key_CONT_START };
}
}
}
}
// When viewing a resource, pass its URI to the native code for opening
@ -299,6 +304,8 @@ public class GL2JNIActivity extends Activity {
// Log.w("INPUT", event.toString() + " " + event.getSource());
// Get all the axis for the KeyEvent
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
Integer playerNum = deviceDescriptor_PlayerNum.get(deviceId_deviceDescriptor.get(event.getDeviceId()));
if (playerNum == null)
@ -340,6 +347,11 @@ public class GL2JNIActivity extends Activity {
return false;
else
return true;
} else {
return false;
}
}
private static final int key_CONT_B = 0x0002;