Bug 1364267 - Prevent Android gamepad from dropping axis values r=ted

MozReview-Commit-ID: 3G5xwPKD4mq
This commit is contained in:
Randall Barker 2017-05-12 10:51:23 -07:00
Родитель 40bbc14054
Коммит 39225e3f07
3 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@ -65,7 +65,9 @@ public:
MOZ_ASSERT(valid.Length() == values.Length());
for (size_t i = 0; i < values.Length(); i++) {
service->NewAxisMoveEvent(aID, i, values[i]);
if (valid[i]) {
service->NewAxisMoveEvent(aID, i, values[i]);
}
}
}
};

Просмотреть файл

@ -129,11 +129,11 @@ public class AndroidGamepadManager {
}
}
@WrapForJNI(calledFrom = "ui", dispatchTo = "gecko_priority")
@WrapForJNI(calledFrom = "ui")
private static native void onGamepadChange(int id, boolean added);
@WrapForJNI(calledFrom = "ui", dispatchTo = "gecko_priority")
@WrapForJNI(calledFrom = "ui")
private static native void onButtonChange(int id, int button, boolean pressed, float value);
@WrapForJNI(calledFrom = "ui", dispatchTo = "gecko_priority")
@WrapForJNI(calledFrom = "ui")
private static native void onAxisChange(int id, boolean[] valid, float[] values);
private static boolean sStarted;
@ -184,7 +184,7 @@ public class AndroidGamepadManager {
}
}
@WrapForJNI(calledFrom = "gecko")
@WrapForJNI
private static void onGamepadAdded(final int device_id, final int service_id) {
ThreadUtils.postToUiThread(new Runnable() {
@Override

Просмотреть файл

@ -36,7 +36,7 @@ public:
static const mozilla::jni::CallingThread callingThread =
mozilla::jni::CallingThread::UI;
static const mozilla::jni::DispatchTarget dispatchTarget =
mozilla::jni::DispatchTarget::GECKO_PRIORITY;
mozilla::jni::DispatchTarget::CURRENT;
};
struct OnButtonChange_t {
@ -57,7 +57,7 @@ public:
static const mozilla::jni::CallingThread callingThread =
mozilla::jni::CallingThread::UI;
static const mozilla::jni::DispatchTarget dispatchTarget =
mozilla::jni::DispatchTarget::GECKO_PRIORITY;
mozilla::jni::DispatchTarget::CURRENT;
};
struct OnGamepadAdded_t {
@ -74,7 +74,7 @@ public:
static const mozilla::jni::ExceptionMode exceptionMode =
mozilla::jni::ExceptionMode::ABORT;
static const mozilla::jni::CallingThread callingThread =
mozilla::jni::CallingThread::GECKO;
mozilla::jni::CallingThread::ANY;
static const mozilla::jni::DispatchTarget dispatchTarget =
mozilla::jni::DispatchTarget::CURRENT;
};
@ -97,7 +97,7 @@ public:
static const mozilla::jni::CallingThread callingThread =
mozilla::jni::CallingThread::UI;
static const mozilla::jni::DispatchTarget dispatchTarget =
mozilla::jni::DispatchTarget::GECKO_PRIORITY;
mozilla::jni::DispatchTarget::CURRENT;
};
struct Start_t {