}
private void removeListeners(Device device) {
if (device.implementsAPI(SystemTriggerAPI.class)) {
try {
final SystemTriggerAPI api = device.getAPI(SystemTriggerAPI.class);
api.removeSystemTriggerListener(debugger);
} catch (ApiNotFoundException ex) {
// Ignore
}
}
if (device.implementsAPI(KeyboardAPI.class)) {
try {
final KeyboardAPI api = device.getAPI(KeyboardAPI.class);
api.removeKeyboardListener(debugger);
} catch (ApiNotFoundException ex) {
// Ignore
}
}
}