aboutsummaryrefslogtreecommitdiffstats
path: root/java-overridable/src
diff options
context:
space:
mode:
Diffstat (limited to 'java-overridable/src')
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/accounts/AccountStateChangedListener.java66
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java46
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java23
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java9
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java18
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java66
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java61
-rw-r--r--java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java49
8 files changed, 314 insertions, 24 deletions
diff --git a/java-overridable/src/com/android/inputmethod/latin/accounts/AccountStateChangedListener.java b/java-overridable/src/com/android/inputmethod/latin/accounts/AccountStateChangedListener.java
new file mode 100644
index 000000000..c0a599c6e
--- /dev/null
+++ b/java-overridable/src/com/android/inputmethod/latin/accounts/AccountStateChangedListener.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2014 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 the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.latin.accounts;
+
+import android.support.annotation.NonNull;
+
+import javax.annotation.Nullable;
+
+/**
+ * Handles changes to account used to sign in to the keyboard.
+ * e.g. account switching/sign-in/sign-out from the keyboard
+ * user toggling the sync preference.
+ */
+public class AccountStateChangedListener {
+
+ /**
+ * Called when the current account being used in keyboard is signed out.
+ *
+ * @param oldAccount the account that was signed out of.
+ */
+ public static void onAccountSignedOut(@NonNull String oldAccount) {
+ }
+
+ /**
+ * Called when the user signs-in to the keyboard.
+ * This may be called when the user switches accounts to sign in with a different account.
+ *
+ * @param oldAccount the previous account that was being used for sign-in.
+ * May be null for a fresh sign-in.
+ * @param newAccount the account being used for sign-in.
+ */
+ public static void onAccountSignedIn(@Nullable String oldAccount, @NonNull String newAccount) {
+ }
+
+ /**
+ * Called when the user toggles the sync preference.
+ *
+ * @param account the account being used for sync.
+ * @param syncEnabled indicates whether sync has been enabled or not.
+ */
+ public static void onSyncPreferenceChanged(@Nullable String account, boolean syncEnabled) {
+ }
+
+ /**
+ * Forces an immediate sync to happen.
+ * This should only be used for debugging purposes.
+ *
+ * @param account the account to use for sync.
+ */
+ public static void forceSync(@Nullable String account) {
+ }
+}
diff --git a/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java b/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java
new file mode 100644
index 000000000..e07a9f358
--- /dev/null
+++ b/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2014 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 the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.latin.accounts;
+
+import android.content.Context;
+
+import javax.annotation.Nonnull;
+
+/**
+ * Utility class for retrieving accounts that may be used for login.
+ */
+public class LoginAccountUtils {
+ /**
+ * This defines the type of account this class deals with.
+ * This account type is used when listing the accounts available on the device for login.
+ */
+ public static final String ACCOUNT_TYPE = "";
+
+ private LoginAccountUtils() {
+ // This utility class is not publicly instantiable.
+ }
+
+ /**
+ * Get the accounts available for login.
+ *
+ * @return an array of accounts. Empty (never null) if no accounts are available for login.
+ */
+ @Nonnull
+ public static String[] getAccountsForLogin(final Context context) {
+ return new String[0];
+ }
+}
diff --git a/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java b/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java
index 5ab126486..99b958952 100644
--- a/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java
+++ b/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java
@@ -24,14 +24,6 @@ public final class ProductionFlags {
public static final boolean IS_HARDWARE_KEYBOARD_SUPPORTED = false;
/**
- * When true, enable {@link InputMethodService#onUpdateCursorAnchorInfo} callback via
- * {@link InputConnection#requestUpdateCursorAnchorInfo}. This flag has no effect in API
- * Level 20 and prior. In general, this callback provides detailed positional information,
- * even though an explicit support is required by the editor.
- */
- public static final boolean ENABLE_CURSOR_ANCHOR_INFO_CALLBACK = true;
-
- /**
* Include all suggestions from all dictionaries in {@link SuggestedWords#mRawSuggestions}.
*/
public static final boolean INCLUDE_RAW_SUGGESTIONS = false;
@@ -40,4 +32,19 @@ public final class ProductionFlags {
* When false, the metrics logging is not yet ready to be enabled.
*/
public static final boolean IS_METRICS_LOGGING_SUPPORTED = false;
+
+ /**
+ * When {@code false}, the split keyboard is not yet ready to be enabled.
+ */
+ public static final boolean IS_SPLIT_KEYBOARD_SUPPORTED = true;
+
+ /**
+ * When {@code false}, account sign-in in keyboard is not yet ready to be enabled.
+ */
+ public static final boolean ENABLE_ACCOUNT_SIGN_IN = false;
+
+ /**
+ * When {@code true}, personal dictionary sync feature is ready to be enabled.
+ */
+ public static final boolean ENABLE_PERSONAL_DICTIONARY_SYNC = ENABLE_ACCOUNT_SIGN_IN && false;
}
diff --git a/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java b/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java
index c97a0d232..8b66cff53 100644
--- a/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java
+++ b/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java
@@ -16,8 +16,6 @@
package com.android.inputmethod.latin.personalization;
-import java.util.Locale;
-
import android.content.Context;
import com.android.inputmethod.latin.DictionaryFacilitator;
@@ -33,12 +31,7 @@ public class PersonalizationDictionaryUpdater {
mDictionaryFacilitator = dictionaryFacilitator;
}
- public Locale getLocale() {
- return null;
- }
-
- public void onLoadSettings(final boolean usePersonalizedDicts,
- final boolean isSystemLocaleSameAsLocaleOfAllEnabledSubtypesOfEnabledImes) {
+ public void onLoadSettings(final boolean usePersonalizedDicts) {
if (!mDictCleared) {
// Clear and never update the personalization dictionary.
PersonalizationHelper.removeAllPersonalizationDictionaries(mContext);
diff --git a/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java b/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java
index 6543003e8..1dfaf259e 100644
--- a/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java
+++ b/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java
@@ -18,8 +18,13 @@ package com.android.inputmethod.latin.settings;
import android.content.Context;
import android.content.SharedPreferences;
+import android.preference.PreferenceFragment;
+import android.view.inputmethod.InputMethodSubtype;
-import com.android.inputmethodcommon.InputMethodSettingsFragment;
+import com.android.inputmethod.latin.RichInputMethodSubtype;
+import com.android.inputmethod.latin.RichInputMethodManager;
+
+import javax.annotation.Nonnull;
/**
* Utility class for managing additional features settings.
@@ -32,12 +37,19 @@ public class AdditionalFeaturesSettingUtils {
}
public static void addAdditionalFeaturesPreferences(
- final Context context, final InputMethodSettingsFragment settingsFragment) {
+ final Context context, final PreferenceFragment settingsFragment) {
// do nothing.
}
- public static void readAdditionalFeaturesPreferencesIntoArray(
+ public static void readAdditionalFeaturesPreferencesIntoArray(final Context context,
final SharedPreferences prefs, final int[] additionalFeaturesPreferences) {
// do nothing.
}
+
+ public static RichInputMethodSubtype createRichInputMethodSubtype(
+ @Nonnull final RichInputMethodManager imm,
+ @Nonnull final InputMethodSubtype subtype,
+ final Context context) {
+ return new RichInputMethodSubtype(subtype);
+ }
}
diff --git a/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java b/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java
new file mode 100644
index 000000000..672d6d1a1
--- /dev/null
+++ b/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2014 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 the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.inputmethod.latin.touchinputconsumer;
+
+import android.view.inputmethod.EditorInfo;
+import com.android.inputmethod.keyboard.Keyboard;
+import com.android.inputmethod.latin.InputPointers;
+import com.android.inputmethod.latin.SuggestedWords;
+import com.android.inputmethod.latin.inputlogic.PrivateCommandPerformer;
+
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Stub for GestureConsumer.
+ * <br>
+ * The methods of this class should only be called from a single thread, e.g.,
+ * the UI Thread.
+ */
+public class GestureConsumer {
+ public static final GestureConsumer NULL_GESTURE_CONSUMER =
+ new GestureConsumer();
+
+ public static GestureConsumer newInstance(
+ final EditorInfo editorInfo, final PrivateCommandPerformer commandPerformer,
+ final List<Locale> locales, final Keyboard keyboard) {
+ return GestureConsumer.NULL_GESTURE_CONSUMER;
+ }
+
+ private GestureConsumer() {
+ }
+
+ public boolean willConsume() {
+ return false;
+ }
+
+ public void onInit(final List<Locale> locales, final Keyboard keyboard) {
+ }
+
+ public void onGestureStarted(final List<Locale> locales, final Keyboard keyboard) {
+ }
+
+ public void onGestureCanceled() {
+ }
+
+ public void onGestureCompleted(final InputPointers inputPointers) {
+ }
+
+ public void onImeSuggestionsProcessed(final SuggestedWords suggestedWords,
+ final int composingStart, final int composingLength) {
+ }
+}
diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java
index 79c19d077..fcaeca827 100644
--- a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java
+++ b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java
@@ -16,19 +16,70 @@
package com.android.inputmethod.latin.utils;
-import android.content.Context;
+import com.android.inputmethod.latin.RichInputMethodManager;
+import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.settings.SettingsValues;
+import javax.annotation.Nullable;
+
public final class StatsUtils {
- public static void init(final Context context) {
+
+ private StatsUtils() {
+ // Intentional empty constructor.
+ }
+
+ public static void onCreate(final SettingsValues settingsValues,
+ RichInputMethodManager richImm) {
+ }
+
+ public static void onPickSuggestionManually(final SuggestedWords suggestedWords,
+ final SuggestedWords.SuggestedWordInfo suggestionInfo) {
+ }
+
+ public static void onBackspaceWordDelete(int wordLength) {
+ }
+
+ public static void onBackspacePressed(int lengthToDelete) {
+ }
+
+ public static void onBackspaceSelectedText(int selectedTextLength) {
+ }
+
+ public static void onDeleteMultiCharInput(int multiCharLength) {
+ }
+
+ public static void onRevertAutoCorrect() {
+ }
+
+ public static void onRevertDoubleSpacePeriod() {
+ }
+
+ public static void onRevertSwapPunctuation() {
+ }
+
+ public static void onFinishInputView() {
+ }
+
+ public static void onCreateInputView() {
+ }
+
+ public static void onStartInputView(int inputType, int displayOrientation, boolean restarting) {
+ }
+
+ public static void onAutoCorrection(final String typedWord, final String autoCorrectionWord,
+ final boolean isBatchInput, @Nullable final String dictionaryType) {
+ }
+
+ public static void onWordCommitUserTyped(final String commitWord, final boolean isBatchMode) {
}
- public static void onCreate(final SettingsValues settingsValues) {
+ public static void onWordCommitAutoCorrect(final String commitWord, final boolean isBatchMode) {
}
- public static void onLoadSettings(final SettingsValues settingsValues) {
+ public static void onWordCommitSuggestionPickedManually(
+ final String commitWord, final boolean isBatchMode) {
}
- public static void onDestroy() {
+ public static void onLoadSettings(SettingsValues settingsValues) {
}
}
diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java
new file mode 100644
index 000000000..138f70f4c
--- /dev/null
+++ b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2014 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 the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package com.android.inputmethod.latin.utils;
+
+import android.content.Context;
+
+import com.android.inputmethod.latin.settings.SettingsValues;
+
+public class StatsUtilsManager {
+
+ private static final StatsUtilsManager sInstance = new StatsUtilsManager();
+
+ /**
+ * @return the singleton instance of {@link StatsUtilsManager}.
+ */
+ public static StatsUtilsManager getInstance() {
+ return sInstance;
+ }
+
+ public void onCreate(final Context context) {
+ }
+
+ public void onLoadSettings(final SettingsValues settingsValues) {
+ }
+
+ public void onStartInputView() {
+ }
+
+ public void onFinishInputView() {
+ }
+
+ public void onDestroy() {
+ }
+}