Fix some obvious compiler warnings
Change-Id: I10a634f7492b45d5a72345f14d36cf341946387d
This commit is contained in:
parent
fc50a41078
commit
c61cd79229
10 changed files with 18 additions and 21 deletions
|
@ -267,12 +267,13 @@ public class InputMethodManagerCompatWrapper {
|
||||||
final InputMethodSubtypeCompatWrapper currentIms = getCurrentInputMethodSubtype();
|
final InputMethodSubtypeCompatWrapper currentIms = getCurrentInputMethodSubtype();
|
||||||
final List<InputMethodInfoCompatWrapper> imiList = getEnabledInputMethodList();
|
final List<InputMethodInfoCompatWrapper> imiList = getEnabledInputMethodList();
|
||||||
imiList.remove(myImi);
|
imiList.remove(myImi);
|
||||||
|
final PackageManager pm = mPackageManager;
|
||||||
Collections.sort(imiList, new Comparator<InputMethodInfoCompatWrapper>() {
|
Collections.sort(imiList, new Comparator<InputMethodInfoCompatWrapper>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(InputMethodInfoCompatWrapper imi1,
|
public int compare(InputMethodInfoCompatWrapper imi1,
|
||||||
InputMethodInfoCompatWrapper imi2) {
|
InputMethodInfoCompatWrapper imi2) {
|
||||||
final CharSequence imiId1 = imi1.loadLabel(mPackageManager) + "/" + imi1.getId();
|
final CharSequence imiId1 = imi1.loadLabel(pm) + "/" + imi1.getId();
|
||||||
final CharSequence imiId2 = imi2.loadLabel(mPackageManager) + "/" + imi2.getId();
|
final CharSequence imiId2 = imi2.loadLabel(pm) + "/" + imi2.getId();
|
||||||
return imiId1.toString().compareTo(imiId2.toString());
|
return imiId1.toString().compareTo(imiId2.toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -302,6 +303,7 @@ public class InputMethodManagerCompatWrapper {
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final InputMethodServiceCompatWrapper service = mService;
|
||||||
final OnClickListener buttonListener = new OnClickListener() {
|
final OnClickListener buttonListener = new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface di, int whichButton) {
|
public void onClick(DialogInterface di, int whichButton) {
|
||||||
|
@ -309,10 +311,9 @@ public class InputMethodManagerCompatWrapper {
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
|
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
|
||||||
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
mService.startActivity(intent);
|
service.startActivity(intent);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
final InputMethodServiceCompatWrapper service = mService;
|
|
||||||
final IBinder token = service.getWindow().getWindow().getAttributes().token;
|
final IBinder token = service.getWindow().getWindow().getAttributes().token;
|
||||||
final OnClickListener selectionListener = new OnClickListener() {
|
final OnClickListener selectionListener = new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -129,7 +129,7 @@ public class SuggestionSpanUtils {
|
||||||
// TODO: Share the implementation for checking typed word validity between the IME
|
// TODO: Share the implementation for checking typed word validity between the IME
|
||||||
// and the spell checker.
|
// and the spell checker.
|
||||||
final int flag = (sameAsTyped && !suggestedWords.mTypedWordValid)
|
final int flag = (sameAsTyped && !suggestedWords.mTypedWordValid)
|
||||||
? ((int)OBJ_FLAG_EASY_CORRECT | (int)OBJ_FLAG_MISSPELLED)
|
? (OBJ_FLAG_EASY_CORRECT | OBJ_FLAG_MISSPELLED)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
final Object[] args =
|
final Object[] args =
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class SuggestionsInfoCompatUtils {
|
||||||
private static final Field FIELD_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS = CompatUtils.getField(
|
private static final Field FIELD_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS = CompatUtils.getField(
|
||||||
SuggestionsInfo.class, "RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS");
|
SuggestionsInfo.class, "RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS");
|
||||||
private static final Integer OBJ_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS = (Integer) CompatUtils
|
private static final Integer OBJ_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS = (Integer) CompatUtils
|
||||||
.getFieldValue(null, null, FIELD_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS);;
|
.getFieldValue(null, null, FIELD_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS);
|
||||||
private static final int RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS =
|
private static final int RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS =
|
||||||
OBJ_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS != null
|
OBJ_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS != null
|
||||||
? OBJ_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS : 0;
|
? OBJ_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS : 0;
|
||||||
|
@ -34,7 +34,7 @@ public class SuggestionsInfoCompatUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the flag value of the attributes of the suggestions that can be obtained by
|
* Returns the flag value of the attributes of the suggestions that can be obtained by
|
||||||
* {@link #getSuggestionsAttributes}: this tells that the text service thinks
|
* {@link SuggestionsInfo#getSuggestionsAttributes()}: this tells that the text service thinks
|
||||||
* the result suggestions include highly recommended ones.
|
* the result suggestions include highly recommended ones.
|
||||||
*/
|
*/
|
||||||
public static int getValueOf_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS() {
|
public static int getValueOf_RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS() {
|
||||||
|
|
|
@ -42,13 +42,13 @@ public interface KeyboardActionListener {
|
||||||
*
|
*
|
||||||
* @param primaryCode this is the code of the key that was pressed
|
* @param primaryCode this is the code of the key that was pressed
|
||||||
* @param x x-coordinate pixel of touched event. If {@link #onCodeInput} is not called by
|
* @param x x-coordinate pixel of touched event. If {@link #onCodeInput} is not called by
|
||||||
* {@link PointerTracker#onTouchEvent} or so, the value should be
|
* {@link PointerTracker} or so, the value should be {@link #NOT_A_TOUCH_COORDINATE}.
|
||||||
* {@link #NOT_A_TOUCH_COORDINATE}. If it's called on insertion from the suggestion
|
* If it's called on insertion from the suggestion strip, it should be
|
||||||
* strip, it should be {@link #SUGGESTION_STRIP_COORDINATE}.
|
* {@link #SUGGESTION_STRIP_COORDINATE}.
|
||||||
* @param y y-coordinate pixel of touched event. If {@link #onCodeInput} is not called by
|
* @param y y-coordinate pixel of touched event. If {@link #onCodeInput} is not called by
|
||||||
* {@link PointerTracker#onTouchEvent} or so, the value should be
|
* {@link PointerTracker} or so, the value should be {@link #NOT_A_TOUCH_COORDINATE}.
|
||||||
* {@link #NOT_A_TOUCH_COORDINATE}. If it's called on insertion from the suggestion
|
* If it's called on insertion from the suggestion strip, it should be
|
||||||
* strip, it should be {@link #SUGGESTION_STRIP_COORDINATE}.
|
* {@link #SUGGESTION_STRIP_COORDINATE}.
|
||||||
*/
|
*/
|
||||||
public void onCodeInput(int primaryCode, int x, int y);
|
public void onCodeInput(int primaryCode, int x, int y);
|
||||||
|
|
||||||
|
|
|
@ -252,7 +252,7 @@ public class BinaryDictionaryFileDumper {
|
||||||
* also apply.
|
* also apply.
|
||||||
*
|
*
|
||||||
* @param input the stream to be copied.
|
* @param input the stream to be copied.
|
||||||
* @param outputFile an outputstream to copy the data to.
|
* @param output an output stream to copy the data to.
|
||||||
*/
|
*/
|
||||||
private static void checkMagicAndCopyFileTo(final BufferedInputStream input,
|
private static void checkMagicAndCopyFileTo(final BufferedInputStream input,
|
||||||
final FileOutputStream output) throws FileNotFoundException, IOException {
|
final FileOutputStream output) throws FileNotFoundException, IOException {
|
||||||
|
|
|
@ -38,7 +38,7 @@ public abstract class Dictionary {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface to be implemented by classes requesting words to be fetched from the dictionary.
|
* Interface to be implemented by classes requesting words to be fetched from the dictionary.
|
||||||
* @see #getWords(WordComposer, WordCallback)
|
* @see #getWords(WordComposer, WordCallback, ProximityInfo)
|
||||||
*/
|
*/
|
||||||
public interface WordCallback {
|
public interface WordCallback {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -68,7 +68,6 @@ import com.android.inputmethod.keyboard.KeyboardId;
|
||||||
import com.android.inputmethod.keyboard.KeyboardSwitcher;
|
import com.android.inputmethod.keyboard.KeyboardSwitcher;
|
||||||
import com.android.inputmethod.keyboard.KeyboardView;
|
import com.android.inputmethod.keyboard.KeyboardView;
|
||||||
import com.android.inputmethod.keyboard.LatinKeyboardView;
|
import com.android.inputmethod.keyboard.LatinKeyboardView;
|
||||||
import com.android.inputmethod.latin.Utils.UsabilityStudyLogUtils;
|
|
||||||
import com.android.inputmethod.latin.define.ProductionFlag;
|
import com.android.inputmethod.latin.define.ProductionFlag;
|
||||||
import com.android.inputmethod.latin.suggestions.SuggestionsView;
|
import com.android.inputmethod.latin.suggestions.SuggestionsView;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
package com.android.inputmethod.latin;
|
package com.android.inputmethod.latin;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.view.inputmethod.EditorInfo;
|
import android.view.inputmethod.EditorInfo;
|
||||||
|
|
||||||
|
|
|
@ -178,9 +178,9 @@ public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChang
|
||||||
}
|
}
|
||||||
if (prefs != null) {
|
if (prefs != null) {
|
||||||
sIsLogging = prefs.getBoolean(PREF_USABILITY_STUDY_MODE, false);
|
sIsLogging = prefs.getBoolean(PREF_USABILITY_STUDY_MODE, false);
|
||||||
}
|
|
||||||
prefs.registerOnSharedPreferenceChangeListener(this);
|
prefs.registerOnSharedPreferenceChangeListener(this);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change to a different logFileManager.
|
* Change to a different logFileManager.
|
||||||
|
|
|
@ -144,9 +144,7 @@ public class WordComposer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new keystroke, with codes[0] containing the pressed key's unicode and the rest of
|
* Add a new keystroke, with the pressed key's code point with the touch point coordinates.
|
||||||
* the array containing unicode for adjacent keys, sorted by reducing probability/proximity.
|
|
||||||
* @param codes the array of unicode values
|
|
||||||
*/
|
*/
|
||||||
private void add(int primaryCode, int keyX, int keyY) {
|
private void add(int primaryCode, int keyX, int keyY) {
|
||||||
final int newIndex = size();
|
final int newIndex = size();
|
||||||
|
|
Loading…
Reference in a new issue