Pressing the physical home buttons of two test devices results in getting the KEYCODE_HOME
KeyEvent
in my AccessibilityService
only on one of the devices. Same manufacturer, different model, different API level. Is a certain API level needed to get the physical home button's KeyEvent
?
@Override
protected boolean onKeyEvent(KeyEvent event) {
if (event.getKeyCode() == KEYCODE_HOME)
Log.d(TAG, "The event works on this device.");
return super.onKeyEvent(event);
}