Remove CODE_RESEARCH

Instead of CODE_RESEARCH, special outputText ".research." is used to
invoke a research feedback dialog.

Change-Id: Ic95c956ab4f2b5f0c3f2205c9bbcdcfb67db5d6e
main
Tadashi G. Takaoka 2013-08-05 18:39:07 +09:00
parent b2c21033ab
commit c0a732f032
4 changed files with 9 additions and 17 deletions

View File

@ -53,7 +53,6 @@ public final class KeyboardCodesSet {
"key_action_previous",
"key_shift_enter",
"key_language_switch",
"key_research",
"key_unspecified",
"key_left_parenthesis",
"key_right_parenthesis",
@ -90,7 +89,6 @@ public final class KeyboardCodesSet {
Constants.CODE_ACTION_PREVIOUS,
Constants.CODE_SHIFT_ENTER,
Constants.CODE_LANGUAGE_SWITCH,
Constants.CODE_RESEARCH,
Constants.CODE_UNSPECIFIED,
CODE_LEFT_PARENTHESIS,
CODE_RIGHT_PARENTHESIS,
@ -118,7 +116,6 @@ public final class KeyboardCodesSet {
DEFAULT[12],
DEFAULT[13],
DEFAULT[14],
DEFAULT[15],
CODE_RIGHT_PARENTHESIS,
CODE_LEFT_PARENTHESIS,
CODE_GREATER_THAN_SIGN,

View File

@ -187,7 +187,6 @@ public final class Constants {
public static final int CODE_ACTION_NEXT = -8;
public static final int CODE_ACTION_PREVIOUS = -9;
public static final int CODE_LANGUAGE_SWITCH = -10;
public static final int CODE_RESEARCH = -11;
public static final int CODE_SHIFT_ENTER = -12;
// Code value representing the code is not specified.
public static final int CODE_UNSPECIFIED = -13;
@ -212,7 +211,6 @@ public final class Constants {
case CODE_UNSPECIFIED: return "unspec";
case CODE_TAB: return "tab";
case CODE_ENTER: return "enter";
case CODE_RESEARCH: return "research";
default:
if (code < CODE_SPACE) return String.format("'\\u%02x'", code);
if (code < 0x100) return String.format("'%c'", code);

View File

@ -1512,11 +1512,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
case Constants.CODE_LANGUAGE_SWITCH:
handleLanguageSwitchKey();
break;
case Constants.CODE_RESEARCH:
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
ResearchLogger.getInstance().onResearchKeySelected(this);
}
break;
case Constants.CODE_ENTER:
final EditorInfo editorInfo = getCurrentInputEditorInfo();
final int imeOptionsActionId =
@ -1608,6 +1603,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
resetComposingState(true /* alsoResetLastComposedWord */);
}
mHandler.postUpdateSuggestionStrip();
if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS
&& ResearchLogger.RESEARCH_KEY_OUTPUT_TEXT.equals(rawText)) {
ResearchLogger.getInstance().onResearchKeySelected(this);
return;
}
final String text = specificTldProcessingOnTextInput(rawText);
if (SPACE_STATE_PHANTOM == mSpaceState) {
promotePhantomSpace();

View File

@ -132,6 +132,9 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
// FEEDBACK_WORD_BUFFER_SIZE should add 1 because it must also hold the feedback LogUnit itself.
public static final int FEEDBACK_WORD_BUFFER_SIZE = (Integer.MAX_VALUE - 1) + 1;
// The special output text to invoke a research feedback dialog.
public static final String RESEARCH_KEY_OUTPUT_TEXT = ".research.";
// constants related to specific log points
private static final String WHITESPACE_SEPARATORS = " \t\n\r";
private static final int MAX_INPUTVIEW_LENGTH_TO_CAPTURE = 8192; // must be >=1
@ -402,6 +405,7 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
}
public void onResearchKeySelected(final LatinIME latinIME) {
mCurrentLogUnit.removeResearchButtonInvocation();
if (mInFeedbackDialog) {
Toast.makeText(latinIME, R.string.research_please_exit_feedback_form,
Toast.LENGTH_LONG).show();
@ -1506,15 +1510,8 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
Constants.printableCode(scrubDigitFromCodePoint(code)),
outputText == null ? null : scrubDigitsFromString(outputText.toString()),
x, y, ignoreModifierKey, altersCode, key.isEnabled());
if (code == Constants.CODE_RESEARCH) {
researchLogger.suppressResearchKeyMotionData();
}
}
}
private void suppressResearchKeyMotionData() {
mCurrentLogUnit.removeResearchButtonInvocation();
}
/**
* Log a call to PointerTracker.callListenerCallListenerOnRelease().