зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1513242 - Queue native calls in GeckoSystemStateListener r=geckoview-reviewers,esawin
Sometimes Gecko isn't running yet when we get our first notifications. Differential Revision: https://phabricator.services.mozilla.com/D14178 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
ef1ac803d8
Коммит
d3663591d0
|
@ -105,8 +105,18 @@ public class GeckoSystemStateListener
|
|||
contentResolver.notifyChange(animationSetting, null);
|
||||
}
|
||||
|
||||
@WrapForJNI(calledFrom = "ui", dispatchTo = "gecko")
|
||||
private static native void onDeviceChanged();
|
||||
@WrapForJNI(stubName = "OnDeviceChanged", calledFrom = "ui", dispatchTo = "gecko")
|
||||
private static native void nativeOnDeviceChanged();
|
||||
|
||||
private static void onDeviceChanged() {
|
||||
if (GeckoThread.isStateAtLeast(GeckoThread.State.PROFILE_READY)) {
|
||||
nativeOnDeviceChanged();
|
||||
} else {
|
||||
GeckoThread.queueNativeCallUntil(
|
||||
GeckoThread.State.PROFILE_READY, GeckoSystemStateListener.class,
|
||||
"nativeOnDeviceChanged");
|
||||
}
|
||||
}
|
||||
|
||||
private void notifyDeviceChanged(int deviceId) {
|
||||
InputDevice device = InputDevice.getDevice(deviceId);
|
||||
|
|
Загрузка…
Ссылка в новой задаче