diff options
Diffstat (limited to 'java-overridable/src')
14 files changed, 329 insertions, 68 deletions
diff --git a/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java b/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java index 21535e421..f5e56eb4b 100644 --- a/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java +++ b/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java @@ -18,6 +18,7 @@ package com.android.inputmethod.compat; import android.content.pm.PackageInfo; +@SuppressWarnings("unused") public class AppWorkaroundsHelper { private AppWorkaroundsHelper() { // This helper class is not publicly instantiable. diff --git a/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java b/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java index ed817658e..d8951df86 100644 --- a/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java +++ b/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java @@ -21,6 +21,7 @@ import android.content.Context; /** * Helper to get the metadata URI from its base URI and the additional ID, if any. */ +@SuppressWarnings("unused") public class MetadataUriGetter { private MetadataUriGetter() { // This helper class is not instantiable. diff --git a/java-overridable/src/com/android/inputmethod/latin/SpecialKeyDetector.java b/java-overridable/src/com/android/inputmethod/latin/SpecialKeyDetector.java deleted file mode 100644 index 27b2f5012..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/SpecialKeyDetector.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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; - -import android.content.Context; -import android.view.KeyEvent; - -final class SpecialKeyDetector { - /** - * Special physical key detector - * @param context a context of this detector. - */ - public SpecialKeyDetector(final Context context) { - } - - /** - * Record a down key event. - * @param keyEvent a down key event. - */ - public void onKeyDown(final KeyEvent keyEvent) { - } - - /** - * Record an up key event. - * @param keyEvent an up key event. - */ - public void onKeyUp(final KeyEvent keyEvent) { - } -} 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..dcc64a223 --- /dev/null +++ b/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java @@ -0,0 +1,47 @@ +/* + * 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 + @SuppressWarnings("unused") + 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..f80625644 100644 --- a/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java +++ b/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java @@ -24,15 +24,8 @@ 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}. + * Include all suggestions from all dictionaries in + * {@link com.android.inputmethod.latin.SuggestedWords#mRawSuggestions}. */ public static final boolean INCLUDE_RAW_SUGGESTIONS = false; @@ -40,4 +33,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/ContextualDictionaryUpdater.java b/java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java index 7dc120e06..fe1d846d8 100644 --- a/java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java +++ b/java-overridable/src/com/android/inputmethod/latin/personalization/ContextualDictionaryUpdater.java @@ -20,6 +20,7 @@ import android.content.Context; import com.android.inputmethod.latin.DictionaryFacilitator; +@SuppressWarnings("unused") public class ContextualDictionaryUpdater { public ContextualDictionaryUpdater(final Context context, final DictionaryFacilitator dictionaryFacilitator, 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..64bace35a 100644 --- a/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java +++ b/java-overridable/src/com/android/inputmethod/latin/personalization/PersonalizationDictionaryUpdater.java @@ -16,12 +16,11 @@ package com.android.inputmethod.latin.personalization; -import java.util.Locale; - import android.content.Context; import com.android.inputmethod.latin.DictionaryFacilitator; +@SuppressWarnings("unused") public class PersonalizationDictionaryUpdater { final Context mContext; final DictionaryFacilitator mDictionaryFacilitator; @@ -33,12 +32,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..4e8a10b1f 100644 --- a/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java +++ b/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java @@ -18,12 +18,18 @@ 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. */ +@SuppressWarnings("unused") public class AdditionalFeaturesSettingUtils { public static final int ADDITIONAL_FEATURES_SETTINGS_SIZE = 0; @@ -32,12 +38,20 @@ 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. } + + @Nonnull + 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..4a44aaa94 --- /dev/null +++ b/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java @@ -0,0 +1,68 @@ +/* + * 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.SuggestedWords; +import com.android.inputmethod.latin.common.InputPointers; +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. + */ +@SuppressWarnings("unused") +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/FeedbackUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java index 0aed41ee4..67de8ba32 100644 --- a/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java +++ b/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java @@ -19,6 +19,7 @@ package com.android.inputmethod.latin.utils; import android.content.Context; import android.content.Intent; +@SuppressWarnings("unused") public class FeedbackUtils { public static boolean isHelpAndFeedbackFormSupported() { return false; diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java b/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java index 9ad319da6..97fb17de3 100644 --- a/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java +++ b/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java @@ -23,6 +23,7 @@ import android.content.Context; /** * Helper class to get the metadata URI and the additional ID. */ +@SuppressWarnings("unused") public class MetadataFileUriGetter { private MetadataFileUriGetter() { // This helper class is not instantiable. 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..044970267 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,71 @@ 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; + +@SuppressWarnings("unused") 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..c99dbf6a1 --- /dev/null +++ b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java @@ -0,0 +1,50 @@ +/* + * 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; + +@SuppressWarnings("unused") +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() { + } +} |