diff options
Diffstat (limited to 'java-overridable/src')
20 files changed, 0 insertions, 940 deletions
diff --git a/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java b/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java deleted file mode 100644 index f5e56eb4b..000000000 --- a/java-overridable/src/com/android/inputmethod/compat/AppWorkaroundsHelper.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2013 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.compat; - -import android.content.pm.PackageInfo; - -@SuppressWarnings("unused") -public class AppWorkaroundsHelper { - private AppWorkaroundsHelper() { - // This helper class is not publicly instantiable. - } - - public static boolean evaluateIsBrokenByRecorrection(final PackageInfo info) { - return false; - } -} diff --git a/java-overridable/src/com/android/inputmethod/dictionarypack/DictionaryPackConstants.java b/java-overridable/src/com/android/inputmethod/dictionarypack/DictionaryPackConstants.java deleted file mode 100644 index 13caea403..000000000 --- a/java-overridable/src/com/android/inputmethod/dictionarypack/DictionaryPackConstants.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2013 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.dictionarypack; - -/** - * A class to group constants for dictionary pack usage. - * - * This class only defines constants. It should not make any references to outside code as far as - * possible, as it's used to separate cleanly the keyboard code from the dictionary pack code; this - * is needed in particular to cleanly compile regression tests. - */ -public class DictionaryPackConstants { - /** - * The root domain for the dictionary pack, upon which authorities and actions will append - * their own distinctive strings. - */ - private static final String DICTIONARY_DOMAIN = "com.android.inputmethod.dictionarypack.aosp"; - - /** - * Authority for the ContentProvider protocol. - */ - // TODO: find some way to factorize this string with the one in the resources - public static final String AUTHORITY = DICTIONARY_DOMAIN; - - /** - * The action of the intent for publishing that new dictionary data is available. - */ - // TODO: make this different across different packages. A suggested course of action is - // to use the package name inside this string. - // NOTE: The appended string should be uppercase like all other actions, but it's not for - // historical reasons. - public static final String NEW_DICTIONARY_INTENT_ACTION = DICTIONARY_DOMAIN + ".newdict"; - - /** - * The action of the intent sent by the dictionary pack to ask for a client to make - * itself known. This is used when the settings activity is brought up for a client the - * dictionary pack does not know about. - */ - public static final String UNKNOWN_DICTIONARY_PROVIDER_CLIENT = DICTIONARY_DOMAIN - + ".UNKNOWN_CLIENT"; - - // In the above intents, the name of the string extra that contains the name of the client - // we want information about. - public static final String DICTIONARY_PROVIDER_CLIENT_EXTRA = "client"; - - /** - * The action of the intent to tell the dictionary provider to update now. - */ - public static final String UPDATE_NOW_INTENT_ACTION = DICTIONARY_DOMAIN - + ".UPDATE_NOW"; - - /** - * The intent action to inform the dictionary provider to initialize the db - * and update now. - */ - public static final String INIT_AND_UPDATE_NOW_INTENT_ACTION = DICTIONARY_DOMAIN - + ".INIT_AND_UPDATE_NOW"; -} diff --git a/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java b/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java deleted file mode 100644 index 512d426aa..000000000 --- a/java-overridable/src/com/android/inputmethod/dictionarypack/MetadataUriGetter.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2013 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.dictionarypack; - -import android.content.Context; - -/** - * Helper to get the metadata URI from its base URI. - */ -@SuppressWarnings("unused") -public class MetadataUriGetter { - public static String getUri(final Context context, final String baseUri) { - return baseUri; - } -} diff --git a/java-overridable/src/com/android/inputmethod/latin/DictionaryFacilitatorProvider.java b/java-overridable/src/com/android/inputmethod/latin/DictionaryFacilitatorProvider.java deleted file mode 100644 index a48b41fa7..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/DictionaryFacilitatorProvider.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2013 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; - -/** - * Factory for instantiating DictionaryFacilitator objects. - */ -public class DictionaryFacilitatorProvider { - public static DictionaryFacilitator getDictionaryFacilitator(boolean isNeededForSpellChecking) { - return new DictionaryFacilitatorImpl(); - } -} diff --git a/java-overridable/src/com/android/inputmethod/latin/about/AboutPreferences.java b/java-overridable/src/com/android/inputmethod/latin/about/AboutPreferences.java deleted file mode 100644 index f60b189f1..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/about/AboutPreferences.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2013 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.about; - -import android.app.Fragment; - -/** - * Dummy class of AboutPreferences. Never use this. - */ -public final class AboutPreferences extends Fragment { - private AboutPreferences() { - // Prevents this from being instantiated - } -} diff --git a/java-overridable/src/com/android/inputmethod/latin/accounts/AccountStateChangedListener.java b/java-overridable/src/com/android/inputmethod/latin/accounts/AccountStateChangedListener.java deleted file mode 100644 index 60d420fc3..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/accounts/AccountStateChangedListener.java +++ /dev/null @@ -1,75 +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.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) { - } - - /** - * Forces an immediate deletion of user's data. - * This should only be used for debugging purposes. - * - * @param account the account to use for sync. - */ - public static void forceDelete(@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 deleted file mode 100644 index dcc64a223..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/accounts/LoginAccountUtils.java +++ /dev/null @@ -1,47 +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.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/DebugFlags.java b/java-overridable/src/com/android/inputmethod/latin/define/DebugFlags.java deleted file mode 100644 index c509e8322..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/define/DebugFlags.java +++ /dev/null @@ -1,31 +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.define; - -import android.content.SharedPreferences; - -public final class DebugFlags { - public static final boolean DEBUG_ENABLED = false; - - private DebugFlags() { - // This class is not publicly instantiable. - } - - @SuppressWarnings("unused") - public static void init(final SharedPreferences prefs) { - } -} diff --git a/java-overridable/src/com/android/inputmethod/latin/define/DecoderSpecificConstants.java b/java-overridable/src/com/android/inputmethod/latin/define/DecoderSpecificConstants.java deleted file mode 100644 index 7f57ce858..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/define/DecoderSpecificConstants.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2015 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.define; - -/** - * Decoder specific constants for LatinIme. - */ -public class DecoderSpecificConstants { - - // Must be equal to MAX_WORD_LENGTH in native/jni/src/defines.h - public static final int DICTIONARY_MAX_WORD_LENGTH = 48; - - // (MAX_PREV_WORD_COUNT_FOR_N_GRAM + 1)-gram is supported in Java side. Needs to modify - // MAX_PREV_WORD_COUNT_FOR_N_GRAM in native/jni/src/defines.h for suggestions. - public static final int MAX_PREV_WORD_COUNT_FOR_N_GRAM = 3; - - public static final String DECODER_DICT_SUFFIX = ""; - - public static final boolean SHOULD_VERIFY_MAGIC_NUMBER = true; - public static final boolean SHOULD_VERIFY_CHECKSUM = true; - public static final boolean SHOULD_USE_DICT_VERSION = true; - public static final boolean SHOULD_AUTO_CORRECT_USING_NON_WHITE_LISTED_SUGGESTION = false; - public static final boolean SHOULD_REMOVE_PREVIOUSLY_REJECTED_SUGGESTION = true; -} diff --git a/java-overridable/src/com/android/inputmethod/latin/define/JniLibName.java b/java-overridable/src/com/android/inputmethod/latin/define/JniLibName.java deleted file mode 100644 index abfc36d39..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/define/JniLibName.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 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.define; - -public final class JniLibName { - private JniLibName() { - // This class is not publicly instantiable. - } - - public static final String JNI_LIB_NAME = "jni_latinime"; -} diff --git a/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java b/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java deleted file mode 100644 index f31c20822..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/define/ProductionFlags.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2012 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.define; - -public final class ProductionFlags { - private ProductionFlags() { - // This class is not publicly instantiable. - } - - public static final boolean IS_HARDWARE_KEYBOARD_SUPPORTED = false; - - /** - * Include all suggestions from all dictionaries in - * {@link com.android.inputmethod.latin.SuggestedWords#mRawSuggestions}. - */ - public static final boolean INCLUDE_RAW_SUGGESTIONS = false; - - /** - * 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}, user history dictionary sync feature is ready to be enabled. - */ - public static final boolean ENABLE_USER_HISTORY_DICTIONARY_SYNC = - ENABLE_ACCOUNT_SIGN_IN && false; - - /** - * When {@code true}, the IME maintains per account {@link UserHistoryDictionary}. - */ - public static final boolean ENABLE_PER_ACCOUNT_USER_HISTORY_DICTIONARY = - ENABLE_ACCOUNT_SIGN_IN && false; -} diff --git a/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java b/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java deleted file mode 100644 index 4e8a10b1f..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/settings/AdditionalFeaturesSettingUtils.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2013 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.settings; - -import android.content.Context; -import android.content.SharedPreferences; -import android.preference.PreferenceFragment; -import android.view.inputmethod.InputMethodSubtype; - -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; - - private AdditionalFeaturesSettingUtils() { - // This utility class is not publicly instantiable. - } - - public static void addAdditionalFeaturesPreferences( - final Context context, final PreferenceFragment settingsFragment) { - // do nothing. - } - - 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 deleted file mode 100644 index 8291b4f72..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/touchinputconsumer/GestureConsumer.java +++ /dev/null @@ -1,69 +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.touchinputconsumer; - -import android.view.inputmethod.EditorInfo; - -import com.android.inputmethod.keyboard.Keyboard; -import com.android.inputmethod.latin.DictionaryFacilitator; -import com.android.inputmethod.latin.SuggestedWords; -import com.android.inputmethod.latin.common.InputPointers; -import com.android.inputmethod.latin.inputlogic.PrivateCommandPerformer; - -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 Locale locale, final Keyboard keyboard) { - return GestureConsumer.NULL_GESTURE_CONSUMER; - } - - private GestureConsumer() { - } - - public boolean willConsume() { - return false; - } - - public void onInit(final Locale locale, final Keyboard keyboard) { - } - - public void onGestureStarted(final Locale locale, final Keyboard keyboard) { - } - - public void onGestureCanceled() { - } - - public void onGestureCompleted(final InputPointers inputPointers) { - } - - public void onImeSuggestionsProcessed(final SuggestedWords suggestedWords, - final int composingStart, final int composingLength, - final DictionaryFacilitator dictionaryFacilitator) { - } -} diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/DictionaryHeaderUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/DictionaryHeaderUtils.java deleted file mode 100644 index 5eb613c9b..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/utils/DictionaryHeaderUtils.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2015 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 com.android.inputmethod.latin.AssetFileAddress; -import com.android.inputmethod.latin.makedict.DictionaryHeader; - -import java.io.File; - -public class DictionaryHeaderUtils { - - public static int getContentVersion(AssetFileAddress fileAddress) { - final DictionaryHeader header = DictionaryInfoUtils.getDictionaryFileHeaderOrNull( - new File(fileAddress.mFilename), fileAddress.mOffset, fileAddress.mLength); - return Integer.parseInt(header.mVersionString); - } -} diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java deleted file mode 100644 index 67de8ba32..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/utils/FeedbackUtils.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2013 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 android.content.Intent; - -@SuppressWarnings("unused") -public class FeedbackUtils { - public static boolean isHelpAndFeedbackFormSupported() { - return false; - } - - public static void showHelpAndFeedbackForm(Context context) { - } - - public static int getAboutKeyboardTitleResId() { - return 0; - } - - public static Intent getAboutKeyboardIntent(Context context) { - return null; - } -} diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/FileTransforms.java b/java-overridable/src/com/android/inputmethod/latin/utils/FileTransforms.java deleted file mode 100644 index 9f4584ec9..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/utils/FileTransforms.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 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 java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.zip.GZIPInputStream; - -public final class FileTransforms { - public static OutputStream getCryptedStream(OutputStream out) { - // Crypt the stream. - return out; - } - - public static InputStream getDecryptedStream(InputStream in) { - // Decrypt the stream. - return in; - } - - public static InputStream getUncompressedStream(InputStream in) throws IOException { - return new GZIPInputStream(in); - } -} diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/ManagedProfileUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/ManagedProfileUtils.java deleted file mode 100644 index ef1872bf4..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/utils/ManagedProfileUtils.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.utils; - -import android.content.Context; - -import com.android.inputmethod.annotations.UsedForTesting; - -public class ManagedProfileUtils { - private static ManagedProfileUtils INSTANCE = new ManagedProfileUtils(); - private static ManagedProfileUtils sTestInstance; - - private ManagedProfileUtils() { - // This utility class is not publicly instantiable. - } - - @UsedForTesting - public static void setTestInstance(final ManagedProfileUtils testInstance) { - sTestInstance = testInstance; - } - - public static ManagedProfileUtils getInstance() { - return sTestInstance == null ? INSTANCE : sTestInstance; - } - - public boolean hasWorkProfile(final Context context) { - return false; - } -}
\ No newline at end of file diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java b/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java deleted file mode 100644 index 97fb17de3..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2013 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 com.android.inputmethod.latin.R; - -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. - } - - public static String getMetadataUri(final Context context) { - return context.getString(R.string.dictionary_pack_metadata_uri); - } - - public static String getMetadataAdditionalId(final Context context) { - return ""; - } -} diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java deleted file mode 100644 index 03e58478b..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtils.java +++ /dev/null @@ -1,110 +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.utils; - -import android.view.inputmethod.InputMethodSubtype; - -import com.android.inputmethod.latin.DictionaryFacilitator; -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 { - - 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, - final DictionaryFacilitator dictionaryFacilitator) { - } - - 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, final DictionaryFacilitator dictionaryFacilitator, - final String prevWordsContext) { - } - - public static void onWordCommitUserTyped(final String commitWord, final boolean isBatchMode) { - } - - public static void onWordCommitAutoCorrect(final String commitWord, final boolean isBatchMode) { - } - - public static void onWordCommitSuggestionPickedManually( - final String commitWord, final boolean isBatchMode) { - } - - public static void onDoubleSpacePeriod() { - } - - public static void onLoadSettings(SettingsValues settingsValues) { - } - - public static void onInvalidWordIdentification(final String invalidWord) { - } - - public static void onSubtypeChanged(final InputMethodSubtype oldSubtype, - final InputMethodSubtype newSubtype) { - } - - public static void onSettingsActivity(final String entryPoint) { - } - - public static void onInputConnectionLaggy(final int operation, final long duration) { - } - - public static void onDecoderLaggy(final int operation, final long duration) { - } -} diff --git a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java b/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java deleted file mode 100644 index cd42f50c7..000000000 --- a/java-overridable/src/com/android/inputmethod/latin/utils/StatsUtilsManager.java +++ /dev/null @@ -1,56 +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.utils; - -import android.content.Context; - -import com.android.inputmethod.latin.DictionaryFacilitator; -import com.android.inputmethod.latin.settings.SettingsValues; - -@SuppressWarnings("unused") -public class StatsUtilsManager { - - private static final StatsUtilsManager sInstance = new StatsUtilsManager(); - private static StatsUtilsManager sTestInstance = null; - - /** - * @return the singleton instance of {@link StatsUtilsManager}. - */ - public static StatsUtilsManager getInstance() { - return sTestInstance != null ? sTestInstance : sInstance; - } - - public static void setTestInstance(final StatsUtilsManager testInstance) { - sTestInstance = testInstance; - } - - public void onCreate(final Context context, final DictionaryFacilitator dictionaryFacilitator) { - } - - public void onLoadSettings(final Context context, final SettingsValues settingsValues) { - } - - public void onStartInputView() { - } - - public void onFinishInputView() { - } - - public void onDestroy(final Context context) { - } -} |