use of android.view.ViewRootImpl in project android_frameworks_base by crdroidandroid.
the class PasswordEntryKeyboardHelper method sendKeyEventsToTarget.
private void sendKeyEventsToTarget(int character) {
ViewRootImpl viewRootImpl = mTargetView.getViewRootImpl();
KeyEvent[] events = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD).getEvents(new char[] { (char) character });
if (events != null) {
final int N = events.length;
for (int i = 0; i < N; i++) {
KeyEvent event = events[i];
event = KeyEvent.changeFlags(event, event.getFlags() | KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE);
viewRootImpl.dispatchInputEvent(event);
}
}
}
Aggregations