diff options
author | 2013-03-19 10:48:10 +0900 | |
---|---|---|
committer | 2013-03-19 10:48:10 +0900 | |
commit | 841c295f3c99214f45924434d9c0bb5b4760578d (patch) | |
tree | 62226e13d2674b0e99e0d49a899aa30ab6b5eb91 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | bbadc6ed2f8a74214bcc328c7b4d7f9bb55d6ef0 (diff) | |
parent | 5b048292540b6fbbd8929a3622262f352245d464 (diff) | |
download | latinime-841c295f3c99214f45924434d9c0bb5b4760578d.tar.gz latinime-841c295f3c99214f45924434d9c0bb5b4760578d.tar.xz latinime-841c295f3c99214f45924434d9c0bb5b4760578d.zip |
resolved conflicts for merge of 5b048292 to master
Change-Id: I67ebab46954cd7b8e3e79e7fed523bafb15f8835
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 71 |
1 files changed, 37 insertions, 34 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index e7c64c695..8d4dd3c32 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -173,9 +173,10 @@ public final class LatinIME extends InputMethodService implements KeyboardAction private int mDisplayOrientation; // Object for reacting to adding/removing a dictionary pack. - // TODO: The experimental version is not supported by the Dictionary Pack Service yet. + // TODO: The development-only-diagnostic version is not supported by the Dictionary Pack + // Service yet. private BroadcastReceiver mDictionaryPackInstallReceiver = - ProductionFlag.IS_EXPERIMENTAL + ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS ? null : new DictionaryPackInstallBroadcastReceiver(this); // Keeps track of most recently inserted text (multi-character key) for reverting @@ -427,7 +428,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction loadSettings(); initSuggest(); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.getInstance().init(this, mKeyboardSwitcher, mSuggest); } mDisplayOrientation = getResources().getConfiguration().orientation; @@ -439,8 +440,9 @@ public final class LatinIME extends InputMethodService implements KeyboardAction filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION); registerReceiver(mReceiver, filter); - // TODO: The experimental version is not supported by the Dictionary Pack Service yet. - if (!ProductionFlag.IS_EXPERIMENTAL) { + // TODO: The development-only-diagnostic version is not supported by the Dictionary Pack + // Service yet. + if (!ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { final IntentFilter packageFilter = new IntentFilter(); packageFilter.addAction(Intent.ACTION_PACKAGE_ADDED); packageFilter.addAction(Intent.ACTION_PACKAGE_REMOVED); @@ -492,7 +494,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction } mIsMainDictionaryAvailable = DictionaryFactory.isDictionaryAvailable(this, subtypeLocale); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.getInstance().initSuggest(mSuggest); } @@ -563,11 +565,12 @@ public final class LatinIME extends InputMethodService implements KeyboardAction } mSettings.onDestroy(); unregisterReceiver(mReceiver); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.getInstance().onDestroy(); } - // TODO: The experimental version is not supported by the Dictionary Pack Service yet. - if (!ProductionFlag.IS_EXPERIMENTAL) { + // TODO: The development-only-diagnostic version is not supported by the Dictionary Pack + // Service yet. + if (!ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { unregisterReceiver(mDictionaryPackInstallReceiver); } LatinImeLogger.commit(); @@ -675,7 +678,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction + ", word caps = " + ((editorInfo.inputType & InputType.TYPE_TEXT_FLAG_CAP_WORDS) != 0)); } - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); ResearchLogger.latinIME_onStartInputViewInternal(editorInfo, prefs); } @@ -800,7 +803,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction @Override public void onWindowHidden() { - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_onWindowHidden(mLastSelectionStart, mLastSelectionEnd, getCurrentInputConnection()); } @@ -831,7 +834,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction // Remove pending messages related to update suggestions mHandler.cancelUpdateSuggestionStrip(); resetComposingState(true /* alsoResetLastComposedWord */); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.getInstance().latinIME_onFinishInputViewInternal(); } } @@ -852,7 +855,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction + ", cs=" + composingSpanStart + ", ce=" + composingSpanEnd); } - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { final boolean expectingUpdateSelectionFromLogger = ResearchLogger.getAndClearLatinIMEExpectingUpdateSelection(); ResearchLogger.latinIME_onUpdateSelection(mLastSelectionStart, mLastSelectionEnd, @@ -984,7 +987,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction mApplicationSpecifiedCompletions = applicationSpecifiedCompletions; if (applicationSpecifiedCompletions == null) { clearSuggestionStrip(); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_onDisplayCompletions(null); } return; @@ -1005,7 +1008,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction setSuggestedWords(suggestedWords, isAutoCorrection); setAutoCorrectionIndicator(isAutoCorrection); setSuggestionStripShown(true); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_onDisplayCompletions(applicationSpecifiedCompletions); } } @@ -1144,7 +1147,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction if (typedWord.length() > 0) { commitChosenWord(typedWord, LastComposedWord.COMMIT_TYPE_USER_TYPED_WORD, separatorString); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.getInstance().onWordFinished(typedWord, mWordComposer.isBatchMode()); } } @@ -1184,7 +1187,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction mConnection.deleteSurroundingText(2, 0); final String text = lastTwo.charAt(1) + " "; mConnection.commitText(text, 1); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_swapSwapperAndSpace(lastTwo, text); } mKeyboardSwitcher.updateShiftState(); @@ -1204,7 +1207,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction mConnection.deleteSurroundingText(2, 0); final String textToInsert = ". "; mConnection.commitText(textToInsert, 1); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_maybeDoubleSpacePeriod(textToInsert, false /* isBatchMode */); } @@ -1319,7 +1322,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction } private void sendKeyCodePoint(final int code) { - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_sendKeyCodePoint(code); } // TODO: Remove this special handling of digit letters. @@ -1345,7 +1348,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction // Implementation of {@link KeyboardActionListener}. @Override public void onCodeInput(final int primaryCode, final int x, final int y) { - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_onCodeInput(primaryCode, x, y); } final long when = SystemClock.uptimeMillis(); @@ -1397,7 +1400,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction handleLanguageSwitchKey(); break; case Constants.CODE_RESEARCH: - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.getInstance().onResearchKeySelected(this); } break; @@ -1489,7 +1492,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction promotePhantomSpace(); } mConnection.commitText(text, 1); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_onTextInput(text, false /* isBatchMode */); } mConnection.endBatchEdit(); @@ -1670,7 +1673,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction mConnection.setComposingText(batchInputText, 1); mExpectingUpdateSelection = true; mConnection.endBatchEdit(); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_onEndBatchInput(batchInputText, 0, suggestedWords); } // Space state must be updated before calling updateShiftState @@ -1719,7 +1722,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction final int length = mWordComposer.size(); if (length > 0) { if (mWordComposer.isBatchMode()) { - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { final String word = mWordComposer.getTypedWord(); ResearchLogger.latinIME_handleBackspace_batch(word, 1); ResearchLogger.getInstance().uncommitCurrentLogUnit( @@ -1780,7 +1783,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction // later (typically, in a subsequent press on backspace). mLastSelectionEnd = mLastSelectionStart; mConnection.deleteSurroundingText(numCharsDeleted, 0); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_handleBackspace(numCharsDeleted); } } else { @@ -1799,12 +1802,12 @@ public final class LatinIME extends InputMethodService implements KeyboardAction } else { mConnection.deleteSurroundingText(1, 0); } - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_handleBackspace(1); } if (mDeleteCount > DELETE_ACCELERATE_AT) { mConnection.deleteSurroundingText(1, 0); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_handleBackspace(1); } } @@ -1903,7 +1906,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction // Returns true if we did an autocorrection, false otherwise. private boolean handleSeparator(final int primaryCode, final int x, final int y, final int spaceState) { - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.recordTimeForLogUnitSplit(); ResearchLogger.latinIME_handleSeparator(primaryCode, mWordComposer.isComposingWord()); } @@ -2148,7 +2151,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction if (mSettings.isInternal()) { Stats.onAutoCorrection(typedWord, autoCorrection, separatorString, mWordComposer); } - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { final SuggestedWords suggestedWords = mSuggestedWords; ResearchLogger.latinIme_commitCurrentAutoCorrection(typedWord, autoCorrection, separatorString, mWordComposer.isBatchMode(), suggestedWords); @@ -2184,7 +2187,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction final int primaryCode = suggestion.charAt(0); onCodeInput(primaryCode, Constants.SUGGESTION_STRIP_COORDINATE, Constants.SUGGESTION_STRIP_COORDINATE); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_punctuationSuggestion(index, suggestion, false /* isBatchMode */, suggestedWords.mIsPrediction); } @@ -2225,7 +2228,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction mExpectingUpdateSelection = true; commitChosenWord(suggestion, LastComposedWord.COMMIT_TYPE_MANUAL_PICK, LastComposedWord.NOT_A_SEPARATOR); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_pickSuggestionManually(replacedWord, index, suggestion, mWordComposer.isBatchMode()); } @@ -2326,7 +2329,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction restartSuggestionsOnWordBeforeCursor(word); // TODO: Handle the case where the user manually moves the cursor and then backs up over // a separator. In that case, the current log unit should not be uncommitted. - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.getInstance().uncommitCurrentLogUnit(word.toString(), true /* dumpCurrentLogUnit */); } @@ -2372,7 +2375,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction Stats.onSeparator(mLastComposedWord.mSeparatorString, Constants.NOT_A_COORDINATE, Constants.NOT_A_COORDINATE); } - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_revertCommit(committedWord, originallyTypedWord, mWordComposer.isBatchMode(), mLastComposedWord.mSeparatorString); ResearchLogger.getInstance().uncommitCurrentLogUnit(committedWord, @@ -2389,7 +2392,7 @@ public final class LatinIME extends InputMethodService implements KeyboardAction public void promotePhantomSpace() { if (mSettings.getCurrent().shouldInsertSpacesAutomatically()) { sendKeyCodePoint(Constants.CODE_SPACE); - if (ProductionFlag.IS_EXPERIMENTAL) { + if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) { ResearchLogger.latinIME_promotePhantomSpace(); } } |