Clear PointerTracker state when more keys keyboard is dismissed

With accessibility mode on, hover events for a more keys keyboard are
handled among MoreKeysKeyboardAccessibilityDelegate and
MoreKeysKeyboardView. But the more keys keyboard is shown by
MainKeyboardAccessibilityDelegate that uses PointerTracker to handle
hover events. Thus we need to clear PointerTracker state when the more
keys keyboard is dismissed.

This is a workaround to resolve the issue. We should reconsider the
structure of those views and accessibility delegates in the future.

Bug: 15583751
Change-Id: Ida8c3e55194c59bdaa5bc4ff06068e699b888ced
main
Tadashi G. Takaoka 2014-06-13 15:20:49 +09:00
parent 03eba0927d
commit 08199ec859
1 changed files with 7 additions and 2 deletions

View File

@ -23,6 +23,7 @@ import android.view.MotionEvent;
import com.android.inputmethod.keyboard.Key;
import com.android.inputmethod.keyboard.KeyDetector;
import com.android.inputmethod.keyboard.MoreKeysKeyboardView;
import com.android.inputmethod.keyboard.PointerTracker;
/**
* This class represents a delegate that can be registered in {@link MoreKeysKeyboardView} to
@ -102,11 +103,15 @@ public class MoreKeysKeyboardAccessibilityDelegate
// Invoke {@link MoreKeysKeyboardView#onUpEvent(int,int,int,long)} as if this hover
// exit event selects a key.
mKeyboardView.onUpEvent(x, y, pointerId, eventTime);
mKeyboardView.dismissMoreKeysPanel();
// TODO: Should fix this reference. This is a hack to clear the state of
// {@link PointerTracker}.
PointerTracker.dismissAllMoreKeysPanels();
return;
}
// Close the more keys keyboard.
mKeyboardView.dismissMoreKeysPanel();
// TODO: Should fix this reference. This is a hack to clear the state of
// {@link PointerTracker}.
PointerTracker.dismissAllMoreKeysPanels();
sendWindowStateChanged(mCloseAnnounceResId);
}
}