mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-21 03:52:48 +00:00
Fix crash in XB1 controller driver on Fire HD 6 after controller removal
This commit is contained in:
parent
f409a3583c
commit
cc71ce6180
@ -129,6 +129,12 @@ public class XboxOneController {
|
|||||||
// Read the next input state packet
|
// Read the next input state packet
|
||||||
long lastMillis = MediaCodecHelper.getMonotonicMillis();
|
long lastMillis = MediaCodecHelper.getMonotonicMillis();
|
||||||
res = connection.bulkTransfer(inEndpt, buffer, buffer.length, 3000);
|
res = connection.bulkTransfer(inEndpt, buffer, buffer.length, 3000);
|
||||||
|
|
||||||
|
// If we get a zero length response, treat it as an error
|
||||||
|
if (res == 0) {
|
||||||
|
res = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (res == -1 && MediaCodecHelper.getMonotonicMillis() - lastMillis < 1000) {
|
if (res == -1 && MediaCodecHelper.getMonotonicMillis() - lastMillis < 1000) {
|
||||||
LimeLog.warning("Detected device I/O error");
|
LimeLog.warning("Detected device I/O error");
|
||||||
XboxOneController.this.stop();
|
XboxOneController.this.stop();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user