aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/res/values-en/donottranslate-more-keys.xml50
-rw-r--r--java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java35
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java11
-rw-r--r--java/src/com/android/inputmethod/latin/LatinImeLogger.java4
-rw-r--r--java/src/com/android/inputmethod/latin/ResearchLogger.java2
-rw-r--r--java/src/com/android/inputmethod/latin/Settings.java6
6 files changed, 74 insertions, 34 deletions
diff --git a/java/res/values-en/donottranslate-more-keys.xml b/java/res/values-en/donottranslate-more-keys.xml
index 9073d3b4f..6e43e86d7 100644
--- a/java/res/values-en/donottranslate-more-keys.xml
+++ b/java/res/values-en/donottranslate-more-keys.xml
@@ -18,12 +18,46 @@
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="more_keys_for_a">à,á,â,ä,æ,ã,å,ā</string>
- <string name="more_keys_for_e">è,é,ê,ë,ē</string>
- <string name="more_keys_for_i">î,ï,í,ī,ì</string>
- <string name="more_keys_for_o">ô,ö,ò,ó,œ,ø,ō,õ</string>
- <string name="more_keys_for_s">ß</string>
- <string name="more_keys_for_u">û,ü,ù,ú,ū</string>
- <string name="more_keys_for_n">ñ</string>
- <string name="more_keys_for_c">ç</string>
+ <!-- U+00E0: "à" LATIN SMALL LETTER A WITH GRAVE
+ U+00E1: "á" LATIN SMALL LETTER A WITH ACUTE
+ U+00E2: "â" LATIN SMALL LETTER A WITH CIRCUMFLEX
+ U+00E4: "ä" LATIN SMALL LETTER A WITH DIAERESIS
+ U+00E6: "æ" LATIN SMALL LETTER AE
+ U+00E3: "ã" LATIN SMALL LETTER A WITH TILDE
+ U+00E5: "å" LATIN SMALL LETTER A WITH RING ABOVE
+ U+0101: "ā" LATIN SMALL LETTER A WITH MACRON -->
+ <string name="more_keys_for_a">&#x00E0;,&#x00E1;,&#x00E2;,&#x00E4;,&#x00E6;,&#x00E3;,&#x00E5;,&#x0101;</string>
+ <!-- U+00E8: "è" LATIN SMALL LETTER E WITH GRAVE
+ U+00E9: "é" LATIN SMALL LETTER E WITH ACUTE
+ U+00EA: "ê" LATIN SMALL LETTER E WITH CIRCUMFLEX
+ U+00EB: "ë" LATIN SMALL LETTER E WITH DIAERESIS
+ U+0113: "ē" LATIN SMALL LETTER E WITH MACRON -->
+ <string name="more_keys_for_e">&#x00E8;,&#x00E9;,&#x00EA;,&#x00EB;,&#x0103;</string>
+ <!-- U+00EE: "î" LATIN SMALL LETTER I WITH CIRCUMFLEX
+ U+00EF: "ï" LATIN SMALL LETTER I WITH DIAERESIS
+ U+00ED: "í" LATIN SMALL LETTER I WITH ACUTE
+ U+012B: "ī" LATIN SMALL LETTER I WITH MACRON
+ U+00EC: "ì" LATIN SMALL LETTER I WITH GRAVE -->
+ <string name="more_keys_for_i">&#x00EE;,&#x00EF;,&#x00ED;,&#x012B;,&#x00EC;</string>
+ <!-- U+00F4: "ô" LATIN SMALL LETTER O WITH CIRCUMFLEX
+ U+00F6: "ö" LATIN SMALL LETTER O WITH DIAERESIS
+ U+00F2: "ò" LATIN SMALL LETTER O WITH GRAVE
+ U+00F3: "ó" LATIN SMALL LETTER O WITH ACUTE
+ U+0153: "œ" LATIN SMALL LIGATURE OE
+ U+00F8: "ø" LATIN SMALL LETTER O WITH STROKE
+ U+014D: "ō" LATIN SMALL LETTER O WITH MACRON
+ U+00F5: "õ" LATIN SMALL LETTER O WITH TILDE -->
+ <string name="more_keys_for_o">&#x00F4;,&#x00F6;,&#x00F2;,&#x00F3;,&#x0153;,&#x00F8;&#x014D;,&#x00F5;</string>
+ <!-- U+00FB: "û" LATIN SMALL LETTER U WITH CIRCUMFLEX
+ U+00FC: "ü" LATIN SMALL LETTER U WITH DIAERESIS
+ U+00F9: "ù" LATIN SMALL LETTER U WITH GRAVE
+ U+00FA: "ú" LATIN SMALL LETTER U WITH ACUTE
+ U+016B: "ū" LATIN SMALL LETTER U WITH MACRON -->
+ <string name="more_keys_for_u">&#x00FB;,&#x00FC;,&#x00F9;,&#x00FA;,&#x016B;</string>
+ <!-- U+00DF: "ß" LATIN SMALL LETTER SHARP S -->
+ <string name="more_keys_for_s">&#x00DF;</string>
+ <!-- U+00F1: "ñ" LATIN SMALL LETTER N WITH TILDE -->
+ <string name="more_keys_for_n">&#x00F1;</string>
+ <!-- U+00E7: "ç" LATIN SMALL LETTER C WITH CEDILLA -->
+ <string name="more_keys_for_c">&#x00E7;</string>
</resources>
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
index 3f6c37477..7194cced3 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
@@ -52,6 +52,7 @@ import com.android.inputmethod.latin.StringUtils;
import com.android.inputmethod.latin.SubtypeUtils;
import com.android.inputmethod.latin.Utils;
import com.android.inputmethod.latin.Utils.UsabilityStudyLogUtils;
+import com.android.inputmethod.latin.define.ProductionFlag;
import java.util.Locale;
import java.util.WeakHashMap;
@@ -694,15 +695,17 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
+ size + "," + pressure);
}
}
- if (ResearchLogger.sIsLogging) {
- // TODO: remove redundant calculations of size and pressure by
- // removing UsabilityStudyLog code once the ResearchLogger is mature enough
- final float size = me.getSize(index);
- final float pressure = me.getPressure(index);
- if (action != MotionEvent.ACTION_MOVE) {
- // Skip ACTION_MOVE events as they are logged below
- ResearchLogger.getInstance().logMotionEvent(action, eventTime, id, x,
- y, size, pressure);
+ if (ProductionFlag.IS_EXPERIMENTAL) {
+ if (ResearchLogger.sIsLogging) {
+ // TODO: remove redundant calculations of size and pressure by
+ // removing UsabilityStudyLog code once the ResearchLogger is mature enough
+ final float size = me.getSize(index);
+ final float pressure = me.getPressure(index);
+ if (action != MotionEvent.ACTION_MOVE) {
+ // Skip ACTION_MOVE events as they are logged below
+ ResearchLogger.getInstance().logMotionEvent(action, eventTime, id, x, y,
+ size, pressure);
+ }
}
}
@@ -770,12 +773,14 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
+ pointerId + "," + px + "," + py + ","
+ pointerSize + "," + pointerPressure);
}
- if (ResearchLogger.sIsLogging) {
- // TODO: earlier comment about redundant calculations applies here too
- final float pointerSize = me.getSize(i);
- final float pointerPressure = me.getPressure(i);
- ResearchLogger.getInstance().logMotionEvent(action, eventTime, pointerId,
- px, py, pointerSize, pointerPressure);
+ if (ProductionFlag.IS_EXPERIMENTAL) {
+ if (ResearchLogger.sIsLogging) {
+ // TODO: earlier comment about redundant calculations applies here too
+ final float pointerSize = me.getSize(i);
+ final float pointerPressure = me.getPressure(i);
+ ResearchLogger.getInstance().logMotionEvent(action, eventTime, pointerId,
+ px, py, pointerSize, pointerPressure);
+ }
}
}
} else {
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 7272006a2..0669ee668 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -69,6 +69,7 @@ import com.android.inputmethod.keyboard.KeyboardSwitcher;
import com.android.inputmethod.keyboard.KeyboardView;
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.suggestions.SuggestionsView;
import java.io.FileDescriptor;
@@ -439,7 +440,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
mPrefs = prefs;
LatinImeLogger.init(this, prefs);
- ResearchLogger.init(this, prefs);
+ if (ProductionFlag.IS_EXPERIMENTAL) {
+ ResearchLogger.init(this, prefs);
+ }
LanguageSwitcherProxy.init(this, prefs);
InputMethodManagerCompatWrapper.init(this);
SubtypeSwitcher.init(this);
@@ -1264,8 +1267,10 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
}
mLastKeyTime = when;
- if (ResearchLogger.sIsLogging) {
- ResearchLogger.getInstance().logKeyEvent(primaryCode, x, y);
+ if (ProductionFlag.IS_EXPERIMENTAL) {
+ if (ResearchLogger.sIsLogging) {
+ ResearchLogger.getInstance().logKeyEvent(primaryCode, x, y);
+ }
}
final KeyboardSwitcher switcher = mKeyboardSwitcher;
diff --git a/java/src/com/android/inputmethod/latin/LatinImeLogger.java b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
index 079f3b5dd..732efadd6 100644
--- a/java/src/com/android/inputmethod/latin/LatinImeLogger.java
+++ b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
@@ -80,8 +80,4 @@ public class LatinImeLogger implements SharedPreferences.OnSharedPreferenceChang
public static void onPrintAllUsabilityStudyLogs() {
}
-
- public static boolean isResearcherPackage(Context context) {
- return false;
- }
}
diff --git a/java/src/com/android/inputmethod/latin/ResearchLogger.java b/java/src/com/android/inputmethod/latin/ResearchLogger.java
index 3b110bd78..0694ffe77 100644
--- a/java/src/com/android/inputmethod/latin/ResearchLogger.java
+++ b/java/src/com/android/inputmethod/latin/ResearchLogger.java
@@ -41,7 +41,7 @@ import java.util.Date;
* This class logs operations on the IME keyboard, including what the user has typed.
* Data is stored locally in a file in app-specific storage.
*
- * This functionality is off by default.
+ * This functionality is off by default. See {@link ProductionFlag.IS_EXPERIMENTAL}.
*/
public class ResearchLogger implements SharedPreferences.OnSharedPreferenceChangeListener {
private static final String TAG = ResearchLogger.class.getSimpleName();
diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java
index 72391f31e..110264892 100644
--- a/java/src/com/android/inputmethod/latin/Settings.java
+++ b/java/src/com/android/inputmethod/latin/Settings.java
@@ -46,6 +46,7 @@ import com.android.inputmethod.compat.CompatUtils;
import com.android.inputmethod.compat.InputMethodServiceCompatWrapper;
import com.android.inputmethod.compat.VibratorCompatWrapper;
import com.android.inputmethod.deprecated.VoiceProxy;
+import com.android.inputmethod.latin.define.ProductionFlag;
import com.android.inputmethodcommon.InputMethodSettingsActivity;
import java.util.Locale;
@@ -238,17 +239,16 @@ public class Settings extends InputMethodSettingsActivity
textCorrectionGroup.removePreference(dictionaryLink);
}
- final boolean isResearcherPackage = LatinImeLogger.isResearcherPackage(this);
final boolean showUsabilityStudyModeOption =
res.getBoolean(R.bool.config_enable_usability_study_mode_option)
- || isResearcherPackage || ENABLE_EXPERIMENTAL_SETTINGS;
+ || ProductionFlag.IS_EXPERIMENTAL || ENABLE_EXPERIMENTAL_SETTINGS;
final Preference usabilityStudyPref = findPreference(PREF_USABILITY_STUDY_MODE);
if (!showUsabilityStudyModeOption) {
if (usabilityStudyPref != null) {
miscSettings.removePreference(usabilityStudyPref);
}
}
- if (isResearcherPackage) {
+ if (ProductionFlag.IS_EXPERIMENTAL) {
if (usabilityStudyPref instanceof CheckBoxPreference) {
CheckBoxPreference checkbox = (CheckBoxPreference)usabilityStudyPref;
checkbox.setChecked(prefs.getBoolean(PREF_USABILITY_STUDY_MODE, true));