aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/deprecated
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/deprecated')
-rw-r--r--java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java2
-rw-r--r--java/src/com/android/inputmethod/deprecated/VoiceProxy.java14
-rw-r--r--java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java4
-rw-r--r--java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java6
-rw-r--r--java/src/com/android/inputmethod/deprecated/recorrection/Recorrection.java28
-rw-r--r--java/src/com/android/inputmethod/deprecated/recorrection/RecorrectionSuggestionEntries.java2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/FieldContext.java2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/Hints.java2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/RecognitionView.java2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/SettingsUtil.java2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/SoundIndicator.java2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/VoiceInput.java6
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/WaveformImage.java2
-rw-r--r--java/src/com/android/inputmethod/deprecated/voice/Whitelist.java2
15 files changed, 39 insertions, 39 deletions
diff --git a/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java b/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java
index e14a49c49..290e6b554 100644
--- a/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java
+++ b/java/src/com/android/inputmethod/deprecated/LanguageSwitcherProxy.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Google Inc.
+ * Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
diff --git a/java/src/com/android/inputmethod/deprecated/VoiceProxy.java b/java/src/com/android/inputmethod/deprecated/VoiceProxy.java
index 753dceead..85993ea4d 100644
--- a/java/src/com/android/inputmethod/deprecated/VoiceProxy.java
+++ b/java/src/com/android/inputmethod/deprecated/VoiceProxy.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Google Inc.
+ * Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
@@ -137,8 +137,8 @@ public class VoiceProxy implements VoiceInput.UiListener {
@Override
public void showHint(int viewResource) {
View view = LayoutInflater.from(mService).inflate(viewResource, null);
- mService.setCandidatesView(view);
- mService.setCandidatesViewShown(true);
+// mService.setCandidatesView(view);
+// mService.setCandidatesViewShown(true);
mIsShowingHint = true;
}
});
@@ -441,7 +441,7 @@ public class VoiceProxy implements VoiceInput.UiListener {
}
builder.setTypedWordValid(true).setHasMinimalSuggestion(true);
mService.setSuggestions(builder.build());
- mService.setCandidatesViewShown(true);
+// mService.setCandidatesViewShown(true);
return true;
}
return false;
@@ -526,7 +526,7 @@ public class VoiceProxy implements VoiceInput.UiListener {
mHandler.post(new Runnable() {
@Override
public void run() {
- mService.setCandidatesViewShown(false);
+// mService.setCandidatesViewShown(false);
mRecognizing = true;
mVoiceInput.newView();
View v = mVoiceInput.getView();
@@ -536,7 +536,7 @@ public class VoiceProxy implements VoiceInput.UiListener {
((ViewGroup) p).removeView(v);
}
- View keyboardView = KeyboardSwitcher.getInstance().getInputView();
+ View keyboardView = KeyboardSwitcher.getInstance().getKeyboardView();
// The full height of the keyboard is difficult to calculate
// as the dimension is expressed in "mm" and not in "pixel"
@@ -691,7 +691,7 @@ public class VoiceProxy implements VoiceInput.UiListener {
if (mSubtypeSwitcher.isVoiceMode() && windowToken != null) {
// Close keyboard view if it is been shown.
if (KeyboardSwitcher.getInstance().isInputViewShown())
- KeyboardSwitcher.getInstance().getInputView().purgeKeyboardAndClosing();
+ KeyboardSwitcher.getInstance().getKeyboardView().purgeKeyboardAndClosing();
startListening(false, windowToken);
}
// If we have no token, onAttachedToWindow will take care of showing dialog and start
diff --git a/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java b/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java
index b8655d112..cf6cd0f5e 100644
--- a/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java
+++ b/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2009 Google Inc.
+ * Copyright (C) 2008-2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
@@ -16,7 +16,7 @@
package com.android.inputmethod.deprecated.languageswitcher;
-import com.android.inputmethod.keyboard.KeyboardParser;
+import com.android.inputmethod.keyboard.internal.KeyboardParser;
import com.android.inputmethod.latin.DictionaryFactory;
import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.Settings;
diff --git a/java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java b/java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java
index 5ef236e31..1eedb5ee1 100644
--- a/java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java
+++ b/java/src/com/android/inputmethod/deprecated/languageswitcher/LanguageSwitcher.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Google Inc.
+ * Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
@@ -20,6 +20,7 @@ import com.android.inputmethod.latin.LatinIME;
import com.android.inputmethod.latin.LatinImeLogger;
import com.android.inputmethod.latin.Settings;
import com.android.inputmethod.latin.SharedPreferencesCompat;
+import com.android.inputmethod.latin.Utils;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
@@ -125,8 +126,7 @@ public class LanguageSwitcher {
private void constructLocales() {
mLocales.clear();
for (final String lang : mSelectedLanguageArray) {
- final Locale locale = new Locale(lang.substring(0, 2),
- lang.length() > 4 ? lang.substring(3, 5) : "");
+ final Locale locale = Utils.constructLocaleFromString(lang);
mLocales.add(locale);
}
}
diff --git a/java/src/com/android/inputmethod/deprecated/recorrection/Recorrection.java b/java/src/com/android/inputmethod/deprecated/recorrection/Recorrection.java
index bf69d5ced..d40728d25 100644
--- a/java/src/com/android/inputmethod/deprecated/recorrection/Recorrection.java
+++ b/java/src/com/android/inputmethod/deprecated/recorrection/Recorrection.java
@@ -17,6 +17,7 @@
package com.android.inputmethod.deprecated.recorrection;
import com.android.inputmethod.compat.InputConnectionCompatUtils;
+import com.android.inputmethod.compat.SuggestionSpanUtils;
import com.android.inputmethod.deprecated.VoiceProxy;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.latin.AutoCorrection;
@@ -43,7 +44,6 @@ import java.util.ArrayList;
* Manager of re-correction functionalities
*/
public class Recorrection implements SharedPreferences.OnSharedPreferenceChangeListener {
- public static final boolean USE_LEGACY_RECORRECTION = true;
private static final Recorrection sInstance = new Recorrection();
private LatinIME mService;
@@ -70,7 +70,7 @@ public class Recorrection implements SharedPreferences.OnSharedPreferenceChangeL
}
private void initInternal(LatinIME context, SharedPreferences prefs) {
- if (!USE_LEGACY_RECORRECTION) {
+ if (SuggestionSpanUtils.SUGGESTION_SPAN_IS_SUPPORTED) {
mRecorrectionEnabled = false;
return;
}
@@ -80,7 +80,7 @@ public class Recorrection implements SharedPreferences.OnSharedPreferenceChangeL
}
public void checkRecorrectionOnStart() {
- if (!USE_LEGACY_RECORRECTION || !mRecorrectionEnabled) return;
+ if (SuggestionSpanUtils.SUGGESTION_SPAN_IS_SUPPORTED || !mRecorrectionEnabled) return;
final InputConnection ic = mService.getCurrentInputConnection();
if (ic == null) return;
@@ -110,7 +110,7 @@ public class Recorrection implements SharedPreferences.OnSharedPreferenceChangeL
CandidateView candidateView, int candidatesStart, int candidatesEnd,
int newSelStart, int newSelEnd, int oldSelStart, int lastSelectionStart,
int lastSelectionEnd, boolean hasUncommittedTypedChars) {
- if (!USE_LEGACY_RECORRECTION || !mRecorrectionEnabled) return;
+ if (SuggestionSpanUtils.SUGGESTION_SPAN_IS_SUPPORTED || !mRecorrectionEnabled) return;
if (!mService.isShowingSuggestionsStrip()) return;
if (!keyboardSwitcher.isInputViewShown()) return;
if (!mService.isSuggestionsRequested()) return;
@@ -142,7 +142,7 @@ public class Recorrection implements SharedPreferences.OnSharedPreferenceChangeL
}
public void saveRecorrectionSuggestion(WordComposer word, CharSequence result) {
- if (!USE_LEGACY_RECORRECTION || !mRecorrectionEnabled) return;
+ if (SuggestionSpanUtils.SUGGESTION_SPAN_IS_SUPPORTED || !mRecorrectionEnabled) return;
if (word.size() <= 1) {
return;
}
@@ -170,7 +170,7 @@ public class Recorrection implements SharedPreferences.OnSharedPreferenceChangeL
*/
public boolean applyTypedAlternatives(WordComposer word, Suggest suggest,
KeyboardSwitcher keyboardSwitcher, EditingUtils.SelectedWord touching) {
- if (!USE_LEGACY_RECORRECTION || !mRecorrectionEnabled) return false;
+ if (SuggestionSpanUtils.SUGGESTION_SPAN_IS_SUPPORTED || !mRecorrectionEnabled) return false;
// If we didn't find a match, search for result in typed word history
WordComposer foundWord = null;
RecorrectionSuggestionEntries alternatives = null;
@@ -218,12 +218,12 @@ public class Recorrection implements SharedPreferences.OnSharedPreferenceChangeL
mService.showSuggestions(builder.build(), entries.getOriginalWord());
}
- public void setRecorrectionSuggestions(VoiceProxy voiceProxy, CandidateView candidateView,
- Suggest suggest, KeyboardSwitcher keyboardSwitcher, WordComposer word,
- boolean hasUncommittedTypedChars, int lastSelectionStart, int lastSelectionEnd,
- String wordSeparators) {
+ public void fetchAndDisplayRecorrectionSuggestions(VoiceProxy voiceProxy,
+ CandidateView candidateView, Suggest suggest, KeyboardSwitcher keyboardSwitcher,
+ WordComposer word, boolean hasUncommittedTypedChars, int lastSelectionStart,
+ int lastSelectionEnd, String wordSeparators) {
if (!InputConnectionCompatUtils.RECORRECTION_SUPPORTED) return;
- if (!USE_LEGACY_RECORRECTION || !mRecorrectionEnabled) return;
+ if (SuggestionSpanUtils.SUGGESTION_SPAN_IS_SUPPORTED || !mRecorrectionEnabled) return;
voiceProxy.setShowingVoiceSuggestions(false);
if (candidateView != null && candidateView.isShowingAddToDictionaryHint()) {
return;
@@ -249,7 +249,7 @@ public class Recorrection implements SharedPreferences.OnSharedPreferenceChangeL
ic.endBatchEdit();
} else {
abortRecorrection(true);
- mService.setPunctuationSuggestions(); // Show the punctuation suggestions list
+ mService.updateBigramPredictions();
}
} else {
abortRecorrection(true);
@@ -257,7 +257,7 @@ public class Recorrection implements SharedPreferences.OnSharedPreferenceChangeL
}
public void abortRecorrection(boolean force) {
- if (!USE_LEGACY_RECORRECTION) return;
+ if (SuggestionSpanUtils.SUGGESTION_SPAN_IS_SUPPORTED) return;
if (force || TextEntryState.isRecorrecting()) {
TextEntryState.onAbortRecorrection();
mService.setCandidatesViewShown(mService.isCandidateStripVisible());
@@ -279,7 +279,7 @@ public class Recorrection implements SharedPreferences.OnSharedPreferenceChangeL
@Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
- if (!USE_LEGACY_RECORRECTION) return;
+ if (SuggestionSpanUtils.SUGGESTION_SPAN_IS_SUPPORTED) return;
if (key.equals(Settings.PREF_RECORRECTION_ENABLED)) {
updateRecorrectionEnabled(mService.getResources(), prefs);
}
diff --git a/java/src/com/android/inputmethod/deprecated/recorrection/RecorrectionSuggestionEntries.java b/java/src/com/android/inputmethod/deprecated/recorrection/RecorrectionSuggestionEntries.java
index 914e2cbc1..5e6c87044 100644
--- a/java/src/com/android/inputmethod/deprecated/recorrection/RecorrectionSuggestionEntries.java
+++ b/java/src/com/android/inputmethod/deprecated/recorrection/RecorrectionSuggestionEntries.java
@@ -57,6 +57,6 @@ public class RecorrectionSuggestionEntries {
private static SuggestedWords.Builder getTypedSuggestions(
Suggest suggest, KeyboardSwitcher keyboardSwitcher, WordComposer word) {
- return suggest.getSuggestedWordBuilder(keyboardSwitcher.getInputView(), word, null);
+ return suggest.getSuggestedWordBuilder(keyboardSwitcher.getKeyboardView(), word, null);
}
}
diff --git a/java/src/com/android/inputmethod/deprecated/voice/FieldContext.java b/java/src/com/android/inputmethod/deprecated/voice/FieldContext.java
index 0ef73d2d7..3c79cc218 100644
--- a/java/src/com/android/inputmethod/deprecated/voice/FieldContext.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/FieldContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc.
+ * Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
diff --git a/java/src/com/android/inputmethod/deprecated/voice/Hints.java b/java/src/com/android/inputmethod/deprecated/voice/Hints.java
index 52a4f4e58..06b234381 100644
--- a/java/src/com/android/inputmethod/deprecated/voice/Hints.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/Hints.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc.
+ * Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
diff --git a/java/src/com/android/inputmethod/deprecated/voice/RecognitionView.java b/java/src/com/android/inputmethod/deprecated/voice/RecognitionView.java
index b57c16f40..dcb826e8f 100644
--- a/java/src/com/android/inputmethod/deprecated/voice/RecognitionView.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/RecognitionView.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc.
+ * Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
diff --git a/java/src/com/android/inputmethod/deprecated/voice/SettingsUtil.java b/java/src/com/android/inputmethod/deprecated/voice/SettingsUtil.java
index 7721fe268..855a09a1d 100644
--- a/java/src/com/android/inputmethod/deprecated/voice/SettingsUtil.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/SettingsUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc.
+ * Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
diff --git a/java/src/com/android/inputmethod/deprecated/voice/SoundIndicator.java b/java/src/com/android/inputmethod/deprecated/voice/SoundIndicator.java
index 8cc79de1e..25b314085 100644
--- a/java/src/com/android/inputmethod/deprecated/voice/SoundIndicator.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/SoundIndicator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Google Inc.
+ * Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
diff --git a/java/src/com/android/inputmethod/deprecated/voice/VoiceInput.java b/java/src/com/android/inputmethod/deprecated/voice/VoiceInput.java
index 7ee0de9c9..b718ebbb7 100644
--- a/java/src/com/android/inputmethod/deprecated/voice/VoiceInput.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/VoiceInput.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc.
+ * Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
@@ -129,7 +129,7 @@ public class VoiceInput implements OnClickListener {
private int mAfterVoiceInputSelectionSpan = 0;
private int mState = DEFAULT;
-
+
private final static int MSG_RESET = 1;
private final Handler mHandler = new Handler() {
@@ -192,7 +192,7 @@ public class VoiceInput implements OnClickListener {
}
mBlacklist = new Whitelist();
- mBlacklist.addApp("com.android.setupwizard");
+ mBlacklist.addApp("com.google.android.setupwizard");
}
public void setCursorPos(int pos) {
diff --git a/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java b/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java
index 87b943426..22e8207bf 100644
--- a/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/VoiceInputLogger.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Google Inc.
+ * Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
diff --git a/java/src/com/android/inputmethod/deprecated/voice/WaveformImage.java b/java/src/com/android/inputmethod/deprecated/voice/WaveformImage.java
index a3025f252..8ed279f42 100644
--- a/java/src/com/android/inputmethod/deprecated/voice/WaveformImage.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/WaveformImage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2009 Google Inc.
+ * Copyright (C) 2008-2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
diff --git a/java/src/com/android/inputmethod/deprecated/voice/Whitelist.java b/java/src/com/android/inputmethod/deprecated/voice/Whitelist.java
index 310689cb2..6c5f52ae2 100644
--- a/java/src/com/android/inputmethod/deprecated/voice/Whitelist.java
+++ b/java/src/com/android/inputmethod/deprecated/voice/Whitelist.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc.
+ * Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of