mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 879791 - Don't send touchscreen hover events to gecko when accessibility is disabled. r=kats
This commit is contained in:
parent
ac67a8df73
commit
2d65260813
@ -150,6 +150,10 @@ public class GeckoAccessibility {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isEnabled() {
|
||||
return sEnabled;
|
||||
}
|
||||
|
||||
public static void sendAccessibilityEvent (final JSONObject message) {
|
||||
if (!sEnabled)
|
||||
return;
|
||||
|
@ -43,6 +43,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputConnection;
|
||||
import android.view.InputDevice;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
/**
|
||||
@ -243,6 +244,13 @@ public class LayerView extends FrameLayout implements Tabs.OnTabsChangedListener
|
||||
|
||||
@Override
|
||||
public boolean onHoverEvent(MotionEvent event) {
|
||||
// If we get a touchscreen hover event, and accessibility is not enabled,
|
||||
// don't send it to gecko.
|
||||
if (event.getSource() == InputDevice.SOURCE_TOUCHSCREEN &&
|
||||
!GeckoAccessibility.isEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return sendEventToGecko(event);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user