diff --git a/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java b/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java index 0576f666c..77f323440 100644 --- a/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java +++ b/java/src/com/android/inputmethod/accessibility/AccessibilityEntityProvider.java @@ -35,8 +35,8 @@ import android.view.inputmethod.EditorInfo; import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardView; -import com.android.inputmethod.latin.CollectionUtils; -import com.android.inputmethod.latin.CoordinateUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.CoordinateUtils; /** * Exposes a virtual view sub-tree for {@link KeyboardView} and generates diff --git a/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java b/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java index ee52de1d1..8929dc7e9 100644 --- a/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java +++ b/java/src/com/android/inputmethod/accessibility/AccessibilityUtils.java @@ -33,8 +33,8 @@ import android.view.accessibility.AccessibilityManager; import android.view.inputmethod.EditorInfo; import com.android.inputmethod.compat.SettingsSecureCompatUtils; -import com.android.inputmethod.latin.InputTypeUtils; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.utils.InputTypeUtils; public final class AccessibilityUtils { private static final String TAG = AccessibilityUtils.class.getSimpleName(); diff --git a/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java b/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java index 05d8269b7..41f5b9a24 100644 --- a/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java +++ b/java/src/com/android/inputmethod/accessibility/KeyCodeDescriptionMapper.java @@ -25,9 +25,9 @@ import android.view.inputmethod.EditorInfo; import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardId; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.HashMap; diff --git a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java index 141e08a8d..e195a5406 100644 --- a/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java +++ b/java/src/com/android/inputmethod/compat/SuggestionSpanUtils.java @@ -23,10 +23,10 @@ import android.text.Spanned; import android.text.TextUtils; import android.text.style.SuggestionSpan; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.SuggestionSpanPickedNotificationReceiver; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.lang.reflect.Field; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/dictionarypack/ActionBatch.java b/java/src/com/android/inputmethod/dictionarypack/ActionBatch.java index bf2230553..be9f87930 100644 --- a/java/src/com/android/inputmethod/dictionarypack/ActionBatch.java +++ b/java/src/com/android/inputmethod/dictionarypack/ActionBatch.java @@ -28,6 +28,8 @@ import android.util.Log; import com.android.inputmethod.compat.DownloadManagerCompatUtils; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.utils.LogUtils; +import com.android.inputmethod.latin.utils.Utils; import java.util.LinkedList; import java.util.Queue; @@ -98,7 +100,7 @@ public final class ActionBatch { final boolean mForceStartNow; public StartDownloadAction(final String clientId, final WordListMetadata wordList, final boolean forceStartNow) { - Utils.l("New download action for client ", clientId, " : ", wordList); + LogUtils.l("New download action for client ", clientId, " : ", wordList); mClientId = clientId; mWordList = wordList; mForceStartNow = forceStartNow; @@ -110,7 +112,7 @@ public final class ActionBatch { Log.e(TAG, "UpdateAction with a null parameter!"); return; } - Utils.l("Downloading word list"); + LogUtils.l("Downloading word list"); final SQLiteDatabase db = MetadataDbHelper.getDb(context, mClientId); final ContentValues values = MetadataDbHelper.getContentValuesByWordListId(db, mWordList.mId, mWordList.mVersion); @@ -132,7 +134,7 @@ public final class ActionBatch { + " for an upgrade action. Fall back to download."); } // Download it. - Utils.l("Upgrade word list, downloading", mWordList.mRemoteFilename); + LogUtils.l("Upgrade word list, downloading", mWordList.mRemoteFilename); // TODO: if DownloadManager is disabled or not installed, download by ourselves if (null == manager) return; @@ -142,7 +144,7 @@ public final class ActionBatch { // DownloadManager also stupidly cuts the extension to replace with its own that it // gets from the content-type. We need to circumvent this. final String disambiguator = "#" + System.currentTimeMillis() - + com.android.inputmethod.latin.Utils.getVersionName(context) + ".dict"; + + Utils.getVersionName(context) + ".dict"; final Uri uri = Uri.parse(mWordList.mRemoteFilename + disambiguator); final Request request = new Request(uri); @@ -178,7 +180,7 @@ public final class ActionBatch { final long downloadId = UpdateHandler.registerDownloadRequest(manager, request, db, mWordList.mId, mWordList.mVersion); - Utils.l("Starting download of", uri, "with id", downloadId); + LogUtils.l("Starting download of", uri, "with id", downloadId); PrivateLog.log("Starting download of " + uri + ", id : " + downloadId); } } @@ -195,7 +197,8 @@ public final class ActionBatch { public InstallAfterDownloadAction(final String clientId, final ContentValues wordListValues) { - Utils.l("New InstallAfterDownloadAction for client ", clientId, " : ", wordListValues); + LogUtils.l("New InstallAfterDownloadAction for client ", clientId, " : ", + wordListValues); mClientId = clientId; mWordListValues = wordListValues; } @@ -213,7 +216,7 @@ public final class ActionBatch { + " for an InstallAfterDownload action. Bailing out."); return; } - Utils.l("Setting word list as installed"); + LogUtils.l("Setting word list as installed"); final SQLiteDatabase db = MetadataDbHelper.getDb(context, mClientId); MetadataDbHelper.markEntryAsFinishedDownloadingAndInstalled(db, mWordListValues); } @@ -229,7 +232,7 @@ public final class ActionBatch { final WordListMetadata mWordList; public EnableAction(final String clientId, final WordListMetadata wordList) { - Utils.l("New EnableAction for client ", clientId, " : ", wordList); + LogUtils.l("New EnableAction for client ", clientId, " : ", wordList); mClientId = clientId; mWordList = wordList; } @@ -240,7 +243,7 @@ public final class ActionBatch { Log.e(TAG, "EnableAction with a null parameter!"); return; } - Utils.l("Enabling word list"); + LogUtils.l("Enabling word list"); final SQLiteDatabase db = MetadataDbHelper.getDb(context, mClientId); final ContentValues values = MetadataDbHelper.getContentValuesByWordListId(db, mWordList.mId, mWordList.mVersion); @@ -264,7 +267,7 @@ public final class ActionBatch { // The word list to disable. May not be null. final WordListMetadata mWordList; public DisableAction(final String clientId, final WordListMetadata wordlist) { - Utils.l("New Disable action for client ", clientId, " : ", wordlist); + LogUtils.l("New Disable action for client ", clientId, " : ", wordlist); mClientId = clientId; mWordList = wordlist; } @@ -275,7 +278,7 @@ public final class ActionBatch { Log.e(TAG, "DisableAction with a null word list!"); return; } - Utils.l("Disabling word list : " + mWordList); + LogUtils.l("Disabling word list : " + mWordList); final SQLiteDatabase db = MetadataDbHelper.getDb(context, mClientId); final ContentValues values = MetadataDbHelper.getContentValuesByWordListId(db, mWordList.mId, mWordList.mVersion); @@ -311,7 +314,7 @@ public final class ActionBatch { // The word list to make available. May not be null. final WordListMetadata mWordList; public MakeAvailableAction(final String clientId, final WordListMetadata wordlist) { - Utils.l("New MakeAvailable action", clientId, " : ", wordlist); + LogUtils.l("New MakeAvailable action", clientId, " : ", wordlist); mClientId = clientId; mWordList = wordlist; } @@ -328,7 +331,7 @@ public final class ActionBatch { Log.e(TAG, "Unexpected state of the word list '" + mWordList.mId + "' " + " for a makeavailable action. Marking as available anyway."); } - Utils.l("Making word list available : " + mWordList); + LogUtils.l("Making word list available : " + mWordList); // If mLocalFilename is null, then it's a remote file that hasn't been downloaded // yet, so we set the local filename to the empty string. final ContentValues values = MetadataDbHelper.makeContentValues(0, @@ -360,7 +363,7 @@ public final class ActionBatch { // The word list to mark pre-installed. May not be null. final WordListMetadata mWordList; public MarkPreInstalledAction(final String clientId, final WordListMetadata wordlist) { - Utils.l("New MarkPreInstalled action", clientId, " : ", wordlist); + LogUtils.l("New MarkPreInstalled action", clientId, " : ", wordlist); mClientId = clientId; mWordList = wordlist; } @@ -377,7 +380,7 @@ public final class ActionBatch { Log.e(TAG, "Unexpected state of the word list '" + mWordList.mId + "' " + " for a markpreinstalled action. Marking as preinstalled anyway."); } - Utils.l("Marking word list preinstalled : " + mWordList); + LogUtils.l("Marking word list preinstalled : " + mWordList); // This word list is pre-installed : we don't have its file. We should reset // the local file name to the empty string so that we don't try to open it // accidentally. The remote filename may be set by the application if it so wishes. @@ -401,7 +404,7 @@ public final class ActionBatch { private final String mClientId; final WordListMetadata mWordList; public UpdateDataAction(final String clientId, final WordListMetadata wordlist) { - Utils.l("New UpdateData action for client ", clientId, " : ", wordlist); + LogUtils.l("New UpdateData action for client ", clientId, " : ", wordlist); mClientId = clientId; mWordList = wordlist; } @@ -419,7 +422,7 @@ public final class ActionBatch { Log.e(TAG, "Trying to update data about a non-existing word list. Bailing out."); return; } - Utils.l("Updating data about a word list : " + mWordList); + LogUtils.l("Updating data about a word list : " + mWordList); final ContentValues values = MetadataDbHelper.makeContentValues( oldValues.getAsInteger(MetadataDbHelper.PENDINGID_COLUMN), oldValues.getAsInteger(MetadataDbHelper.TYPE_COLUMN), @@ -453,7 +456,7 @@ public final class ActionBatch { final boolean mHasNewerVersion; public ForgetAction(final String clientId, final WordListMetadata wordlist, final boolean hasNewerVersion) { - Utils.l("New TryRemove action for client ", clientId, " : ", wordlist); + LogUtils.l("New TryRemove action for client ", clientId, " : ", wordlist); mClientId = clientId; mWordList = wordlist; mHasNewerVersion = hasNewerVersion; @@ -465,7 +468,7 @@ public final class ActionBatch { Log.e(TAG, "TryRemoveAction with a null word list!"); return; } - Utils.l("Trying to remove word list : " + mWordList); + LogUtils.l("Trying to remove word list : " + mWordList); final SQLiteDatabase db = MetadataDbHelper.getDb(context, mClientId); final ContentValues values = MetadataDbHelper.getContentValuesByWordListId(db, mWordList.mId, mWordList.mVersion); @@ -525,7 +528,7 @@ public final class ActionBatch { // The word list to delete. May not be null. final WordListMetadata mWordList; public StartDeleteAction(final String clientId, final WordListMetadata wordlist) { - Utils.l("New StartDelete action for client ", clientId, " : ", wordlist); + LogUtils.l("New StartDelete action for client ", clientId, " : ", wordlist); mClientId = clientId; mWordList = wordlist; } @@ -536,7 +539,7 @@ public final class ActionBatch { Log.e(TAG, "StartDeleteAction with a null word list!"); return; } - Utils.l("Trying to delete word list : " + mWordList); + LogUtils.l("Trying to delete word list : " + mWordList); final SQLiteDatabase db = MetadataDbHelper.getDb(context, mClientId); final ContentValues values = MetadataDbHelper.getContentValuesByWordListId(db, mWordList.mId, mWordList.mVersion); @@ -564,7 +567,7 @@ public final class ActionBatch { // The word list to delete. May not be null. final WordListMetadata mWordList; public FinishDeleteAction(final String clientId, final WordListMetadata wordlist) { - Utils.l("New FinishDelete action for client", clientId, " : ", wordlist); + LogUtils.l("New FinishDelete action for client", clientId, " : ", wordlist); mClientId = clientId; mWordList = wordlist; } @@ -575,7 +578,7 @@ public final class ActionBatch { Log.e(TAG, "FinishDeleteAction with a null word list!"); return; } - Utils.l("Trying to delete word list : " + mWordList); + LogUtils.l("Trying to delete word list : " + mWordList); final SQLiteDatabase db = MetadataDbHelper.getDb(context, mClientId); final ContentValues values = MetadataDbHelper.getContentValuesByWordListId(db, mWordList.mId, mWordList.mVersion); @@ -632,7 +635,7 @@ public final class ActionBatch { * @param reporter a Reporter to send errors to. */ public void execute(final Context context, final ProblemReporter reporter) { - Utils.l("Executing a batch of actions"); + LogUtils.l("Executing a batch of actions"); Queue remainingActions = mActions; while (!remainingActions.isEmpty()) { final Action a = remainingActions.poll(); diff --git a/java/src/com/android/inputmethod/dictionarypack/DictionaryListInterfaceState.java b/java/src/com/android/inputmethod/dictionarypack/DictionaryListInterfaceState.java index 5ad5900d4..f1a2a8333 100644 --- a/java/src/com/android/inputmethod/dictionarypack/DictionaryListInterfaceState.java +++ b/java/src/com/android/inputmethod/dictionarypack/DictionaryListInterfaceState.java @@ -18,7 +18,7 @@ package com.android.inputmethod.dictionarypack; import android.view.View; -import com.android.inputmethod.latin.CollectionUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.ArrayList; import java.util.HashMap; diff --git a/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java b/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java index 4fbe16233..4aa4d4b43 100644 --- a/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java +++ b/java/src/com/android/inputmethod/dictionarypack/DictionaryProvider.java @@ -31,6 +31,7 @@ import android.text.TextUtils; import android.util.Log; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.utils.LogUtils; import java.io.File; import java.io.FileNotFoundException; @@ -219,7 +220,7 @@ public final class DictionaryProvider extends ContentProvider { @Override public Cursor query(final Uri uri, final String[] projection, final String selection, final String[] selectionArgs, final String sortOrder) { - Utils.l("Uri =", uri); + LogUtils.l("Uri =", uri); PrivateLog.log("Query : " + uri); final String clientId = getClientId(uri); final int match = matchUri(uri); @@ -227,7 +228,7 @@ public final class DictionaryProvider extends ContentProvider { case DICTIONARY_V1_WHOLE_LIST: case DICTIONARY_V2_WHOLE_LIST: final Cursor c = MetadataDbHelper.queryDictionaries(getContext(), clientId); - Utils.l("List of dictionaries with count", c.getCount()); + LogUtils.l("List of dictionaries with count", c.getCount()); PrivateLog.log("Returned a list of " + c.getCount() + " items"); return c; case DICTIONARY_V2_DICT_INFO: diff --git a/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java b/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java index dac12137d..c6cadb823 100644 --- a/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java +++ b/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java @@ -25,6 +25,7 @@ import android.text.TextUtils; import android.util.Log; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.utils.LogUtils; import java.io.File; import java.util.ArrayList; @@ -772,12 +773,12 @@ public class MetadataDbHelper extends SQLiteOpenHelper { if (TextUtils.isEmpty(valuesClientId) || null == valuesMetadataUri || null == valuesMetadataAdditionalId) { // We need all these columns to be filled in - Utils.l("Missing parameter for updateClientInfo"); + LogUtils.l("Missing parameter for updateClientInfo"); return; } if (!clientId.equals(valuesClientId)) { // Mismatch! The client violates the protocol. - Utils.l("Received an updateClientInfo request for ", clientId, " but the values " + LogUtils.l("Received an updateClientInfo request for ", clientId, " but the values " + "contain a different ID : ", valuesClientId); return; } @@ -847,7 +848,7 @@ public class MetadataDbHelper extends SQLiteOpenHelper { final ContentValues r) { switch (r.getAsInteger(TYPE_COLUMN)) { case TYPE_BULK: - Utils.l("Ended processing a wordlist"); + LogUtils.l("Ended processing a wordlist"); // Updating a bulk word list is a three-step operation: // - Add the new entry to the table // - Remove the old entry from the table @@ -869,7 +870,7 @@ public class MetadataDbHelper extends SQLiteOpenHelper { // the phone is suddenly cut during an update. final int filenameIndex = c.getColumnIndex(LOCAL_FILENAME_COLUMN); do { - Utils.l("Setting for removal", c.getString(filenameIndex)); + LogUtils.l("Setting for removal", c.getString(filenameIndex)); filenames.add(c.getString(filenameIndex)); } while (c.moveToNext()); } diff --git a/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java b/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java index 3f917f13f..936d00d25 100644 --- a/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java +++ b/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java @@ -38,6 +38,8 @@ import android.util.Log; import com.android.inputmethod.compat.ConnectivityManagerCompatUtils; import com.android.inputmethod.compat.DownloadManagerCompatUtils; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.utils.LogUtils; +import com.android.inputmethod.latin.utils.Utils; import java.io.File; import java.io.FileInputStream; @@ -183,8 +185,8 @@ public final class UpdateHandler { final String clientId = cursor.getString(0); final String metadataUri = MetadataDbHelper.getMetadataUriAsString(context, clientId); - PrivateLog.log("Update for clientId " + Utils.s(clientId)); - Utils.l("Update for clientId", clientId, " which uses URI ", metadataUri); + PrivateLog.log("Update for clientId " + LogUtils.s(clientId)); + LogUtils.l("Update for clientId", clientId, " which uses URI ", metadataUri); uris.add(metadataUri); } while (cursor.moveToNext()); } finally { @@ -211,14 +213,14 @@ public final class UpdateHandler { */ private static void updateClientsWithMetadataUri(final Context context, final boolean updateNow, final String metadataUri) { - PrivateLog.log("Update for metadata URI " + Utils.s(metadataUri)); + PrivateLog.log("Update for metadata URI " + LogUtils.s(metadataUri)); // Adding a disambiguator to circumvent a bug in older versions of DownloadManager. // DownloadManager also stupidly cuts the extension to replace with its own that it // gets from the content-type. We need to circumvent this. final String disambiguator = "#" + System.currentTimeMillis() - + com.android.inputmethod.latin.Utils.getVersionName(context) + ".json"; + + Utils.getVersionName(context) + ".json"; final Request metadataRequest = new Request(Uri.parse(metadataUri + disambiguator)); - Utils.l("Request =", metadataRequest); + LogUtils.l("Request =", metadataRequest); final Resources res = context.getResources(); // By default, download over roaming is allowed and all network types are allowed too. @@ -254,7 +256,7 @@ public final class UpdateHandler { final long downloadId; synchronized (sSharedIdProtector) { downloadId = manager.enqueue(metadataRequest); - Utils.l("Metadata download requested with id", downloadId); + LogUtils.l("Metadata download requested with id", downloadId); // If there is already a download in progress, it's been there for a while and // there is probably something wrong with download manager. It's best to just // overwrite the id and request it again. If the old one happens to finish @@ -326,11 +328,11 @@ public final class UpdateHandler { */ public static long registerDownloadRequest(final DownloadManager manager, final Request request, final SQLiteDatabase db, final String id, final int version) { - Utils.l("RegisterDownloadRequest for word list id : ", id, ", version ", version); + LogUtils.l("RegisterDownloadRequest for word list id : ", id, ", version ", version); final long downloadId; synchronized (sSharedIdProtector) { downloadId = manager.enqueue(request); - Utils.l("Download requested with id", downloadId); + LogUtils.l("Download requested with id", downloadId); MetadataDbHelper.markEntryAsDownloading(db, id, version, downloadId); } return downloadId; @@ -416,7 +418,7 @@ public final class UpdateHandler { // Get and check the ID of the file that was downloaded final long fileId = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, NOT_AN_ID); PrivateLog.log("Download finished with id " + fileId); - Utils.l("DownloadFinished with id", fileId); + LogUtils.l("DownloadFinished with id", fileId); if (NOT_AN_ID == fileId) return; // Spurious wake-up: ignore final DownloadManager manager = @@ -426,7 +428,7 @@ public final class UpdateHandler { final ArrayList recordList = getDownloadRecordsForCompletedDownloadInfo(context, downloadInfo); if (null == recordList) return; // It was someone else's download. - Utils.l("Received result for download ", fileId); + LogUtils.l("Received result for download ", fileId); // TODO: handle gracefully a null pointer here. This is practically impossible because // we come here only when DownloadManager explicitly called us when it ended a @@ -503,7 +505,7 @@ public final class UpdateHandler { private static void publishUpdateCycleCompletedEvent(final Context context) { // Even if this is not successful, we have to publish the new state. PrivateLog.log("Publishing update cycle completed event"); - Utils.l("Publishing update cycle completed event"); + LogUtils.l("Publishing update cycle completed event"); for (UpdateEventListener listener : linkedCopyOfList(sUpdateEventListeners)) { listener.updateCycleCompleted(); } @@ -517,12 +519,12 @@ public final class UpdateHandler { // {@link handleWordList(Context,InputStream,ContentValues)}. // Handle the downloaded file according to its type if (downloadRecord.isMetadata()) { - Utils.l("Data D/L'd is metadata for", downloadRecord.mClientId); + LogUtils.l("Data D/L'd is metadata for", downloadRecord.mClientId); // #handleMetadata() closes its InputStream argument handleMetadata(context, new ParcelFileDescriptor.AutoCloseInputStream( manager.openDownloadedFile(fileId)), downloadRecord.mClientId); } else { - Utils.l("Data D/L'd is a word list"); + LogUtils.l("Data D/L'd is a word list"); final int wordListStatus = downloadRecord.mAttributes.getAsInteger( MetadataDbHelper.STATUS_COLUMN); if (MetadataDbHelper.STATUS_DOWNLOADING == wordListStatus) { @@ -582,7 +584,7 @@ public final class UpdateHandler { */ private static void handleMetadata(final Context context, final InputStream stream, final String clientId) throws IOException, BadFormatException { - Utils.l("Entering handleMetadata"); + LogUtils.l("Entering handleMetadata"); final List newMetadata; final InputStreamReader reader = new InputStreamReader(stream); try { @@ -592,7 +594,7 @@ public final class UpdateHandler { reader.close(); } - Utils.l("Downloaded metadata :", newMetadata); + LogUtils.l("Downloaded metadata :", newMetadata); PrivateLog.log("Downloaded metadata\n" + newMetadata); final ActionBatch actions = computeUpgradeTo(context, clientId, newMetadata); @@ -617,7 +619,7 @@ public final class UpdateHandler { // DownloadManager does not have the ability to put the file directly where we want // it, so we had it download to a temporary place. Now we move it. It will be deleted // automatically by DownloadManager. - Utils.l("Downloaded a new word list :", downloadRecord.mAttributes.getAsString( + LogUtils.l("Downloaded a new word list :", downloadRecord.mAttributes.getAsString( MetadataDbHelper.DESCRIPTION_COLUMN), "for", downloadRecord.mClientId); PrivateLog.log("Downloaded a new word list with description : " + downloadRecord.mAttributes.getAsString(MetadataDbHelper.DESCRIPTION_COLUMN) @@ -676,9 +678,9 @@ public final class UpdateHandler { */ private static void copyFile(final InputStream in, final OutputStream out) throws IOException { - Utils.l("Copying files"); + LogUtils.l("Copying files"); if (!(in instanceof FileInputStream) || !(out instanceof FileOutputStream)) { - Utils.l("Not the right types"); + LogUtils.l("Not the right types"); copyFileFallback(in, out); } else { try { @@ -687,7 +689,7 @@ public final class UpdateHandler { sourceChannel.transferTo(0, Integer.MAX_VALUE, destinationChannel); } catch (IOException e) { // Can't work with channels, or something went wrong. Copy by hand. - Utils.l("Won't work"); + LogUtils.l("Won't work"); copyFileFallback(in, out); } } @@ -702,7 +704,7 @@ public final class UpdateHandler { */ private static void copyFileFallback(final InputStream in, final OutputStream out) throws IOException { - Utils.l("Falling back to slow copy"); + LogUtils.l("Falling back to slow copy"); final byte[] buffer = new byte[FILE_COPY_BUFFER_SIZE]; for (int readBytes = in.read(buffer); readBytes >= 0; readBytes = in.read(buffer)) out.write(buffer, 0, readBytes); @@ -717,10 +719,10 @@ public final class UpdateHandler { */ private static String getTempFileName(final Context context, final String locale) throws IOException { - Utils.l("Entering openTempFileOutput"); + LogUtils.l("Entering openTempFileOutput"); final File dir = context.getFilesDir(); final File f = File.createTempFile(locale + "___", DICT_FILE_SUFFIX, dir); - Utils.l("File name is", f.getName()); + LogUtils.l("File name is", f.getName()); return f.getName(); } @@ -741,7 +743,7 @@ public final class UpdateHandler { final String clientId, List from, List to) { final ActionBatch actions = new ActionBatch(); // Upgrade existing word lists - Utils.l("Comparing dictionaries"); + LogUtils.l("Comparing dictionaries"); final Set wordListIds = new TreeSet(); // TODO: Can these be null? if (null == from) from = new ArrayList(); @@ -756,7 +758,7 @@ public final class UpdateHandler { final WordListMetadata newInfo = null == metadataInfo || metadataInfo.mFormatVersion > MAXIMUM_SUPPORTED_FORMAT_VERSION ? null : metadataInfo; - Utils.l("Considering updating ", id, "currentInfo =", currentInfo); + LogUtils.l("Considering updating ", id, "currentInfo =", currentInfo); if (null == currentInfo && null == newInfo) { // This may happen if a new word list appeared that we can't handle. diff --git a/java/src/com/android/inputmethod/event/EventInterpreter.java b/java/src/com/android/inputmethod/event/EventInterpreter.java index 6efe899bb..726b9206b 100644 --- a/java/src/com/android/inputmethod/event/EventInterpreter.java +++ b/java/src/com/android/inputmethod/event/EventInterpreter.java @@ -19,9 +19,9 @@ package com.android.inputmethod.event; import android.util.SparseArray; import android.view.KeyEvent; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.LatinIME; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index 4ef8653f6..09f1145e9 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -41,7 +41,7 @@ import com.android.inputmethod.keyboard.internal.KeyboardRow; import com.android.inputmethod.keyboard.internal.MoreKeySpec; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.StringUtils; +import com.android.inputmethod.latin.utils.StringUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java index e87ecbc7e..fefac96fd 100644 --- a/java/src/com/android/inputmethod/keyboard/Keyboard.java +++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java @@ -21,8 +21,8 @@ import android.util.SparseArray; import com.android.inputmethod.keyboard.internal.KeyVisualAttributes; import com.android.inputmethod.keyboard.internal.KeyboardIconsSet; import com.android.inputmethod.keyboard.internal.KeyboardParams; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.Constants; +import com.android.inputmethod.latin.utils.CollectionUtils; /** * Loads an XML description of a keyboard and stores the attributes of the keys. A keyboard diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java index 4c5dd25c4..d00521c58 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java @@ -25,8 +25,8 @@ import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodSubtype; import com.android.inputmethod.compat.EditorInfoCompatUtils; -import com.android.inputmethod.latin.InputTypeUtils; import com.android.inputmethod.latin.SubtypeLocale; +import com.android.inputmethod.latin.utils.InputTypeUtils; import java.util.Arrays; import java.util.Locale; diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java index a074b6334..c4f5eb035 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java @@ -42,15 +42,15 @@ import com.android.inputmethod.keyboard.internal.KeyboardBuilder; import com.android.inputmethod.keyboard.internal.KeyboardParams; import com.android.inputmethod.keyboard.internal.KeysCache; import com.android.inputmethod.latin.AdditionalSubtype; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.InputAttributes; -import com.android.inputmethod.latin.InputTypeUtils; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResourceUtils; import com.android.inputmethod.latin.SubtypeLocale; import com.android.inputmethod.latin.SubtypeSwitcher; -import com.android.inputmethod.latin.XmlParseUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.InputTypeUtils; +import com.android.inputmethod.latin.utils.ResourceUtils; +import com.android.inputmethod.latin.utils.XmlParseUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index 7941fcba2..4cee4cfa6 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -32,11 +32,11 @@ import android.view.View; import com.android.inputmethod.keyboard.internal.KeyDrawParams; import com.android.inputmethod.keyboard.internal.KeyVisualAttributes; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.latin.utils.CollectionUtils; import com.android.inputmethod.research.ResearchLogger; import java.util.HashSet; diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java index 7f335027f..8a926d655 100644 --- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java @@ -58,21 +58,21 @@ import com.android.inputmethod.keyboard.internal.PreviewPlacerView; import com.android.inputmethod.keyboard.internal.SlidingKeyInputPreview; import com.android.inputmethod.keyboard.internal.TouchScreenRegulator; import com.android.inputmethod.latin.AudioAndHapticFeedbackManager; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.Constants; -import com.android.inputmethod.latin.CoordinateUtils; import com.android.inputmethod.latin.DebugSettings; import com.android.inputmethod.latin.LatinIME; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResourceUtils; import com.android.inputmethod.latin.Settings; -import com.android.inputmethod.latin.StaticInnerHandlerWrapper; -import com.android.inputmethod.latin.StringUtils; import com.android.inputmethod.latin.SubtypeLocale; import com.android.inputmethod.latin.SuggestedWords; -import com.android.inputmethod.latin.Utils.UsabilityStudyLogUtils; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.CoordinateUtils; +import com.android.inputmethod.latin.utils.ResourceUtils; +import com.android.inputmethod.latin.utils.StaticInnerHandlerWrapper; +import com.android.inputmethod.latin.utils.StringUtils; +import com.android.inputmethod.latin.utils.Utils.UsabilityStudyLogUtils; import com.android.inputmethod.research.ResearchLogger; import java.util.Locale; diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java index ae08a5953..3b1f6d510 100644 --- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java +++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java @@ -28,7 +28,7 @@ import com.android.inputmethod.keyboard.internal.KeyboardIconsSet; import com.android.inputmethod.keyboard.internal.KeyboardParams; import com.android.inputmethod.keyboard.internal.MoreKeySpec; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.StringUtils; +import com.android.inputmethod.latin.utils.StringUtils; public final class MoreKeysKeyboard extends Keyboard { private final int mDefaultKeyCoordX; diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java index a82fb79bd..897ad1d13 100644 --- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboardView.java @@ -23,8 +23,8 @@ import android.view.MotionEvent; import android.view.View; import com.android.inputmethod.latin.Constants; -import com.android.inputmethod.latin.CoordinateUtils; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.utils.CoordinateUtils; /** * A view that renders a virtual {@link MoreKeysKeyboard}. It handles rendering of keys and diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index 958aaf569..7b14259a0 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -27,13 +27,13 @@ import com.android.inputmethod.keyboard.internal.GestureStroke.GestureStrokePara import com.android.inputmethod.keyboard.internal.GestureStrokeWithPreviewPoints; import com.android.inputmethod.keyboard.internal.GestureStrokeWithPreviewPoints.GestureStrokePreviewParams; import com.android.inputmethod.keyboard.internal.PointerTrackerQueue; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.Constants; -import com.android.inputmethod.latin.CoordinateUtils; import com.android.inputmethod.latin.InputPointers; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.CoordinateUtils; import com.android.inputmethod.research.ResearchLogger; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/keyboard/ProximityInfo.java b/java/src/com/android/inputmethod/keyboard/ProximityInfo.java index 0e86b051d..9b0a33cec 100644 --- a/java/src/com/android/inputmethod/keyboard/ProximityInfo.java +++ b/java/src/com/android/inputmethod/keyboard/ProximityInfo.java @@ -22,7 +22,7 @@ import android.util.Log; import com.android.inputmethod.keyboard.internal.TouchPositionCorrection; import com.android.inputmethod.latin.Constants; -import com.android.inputmethod.latin.JniUtils; +import com.android.inputmethod.latin.utils.JniUtils; import java.util.Arrays; diff --git a/java/src/com/android/inputmethod/keyboard/TypefaceUtils.java b/java/src/com/android/inputmethod/keyboard/TypefaceUtils.java index 6a54e119c..c3b952037 100644 --- a/java/src/com/android/inputmethod/keyboard/TypefaceUtils.java +++ b/java/src/com/android/inputmethod/keyboard/TypefaceUtils.java @@ -21,7 +21,7 @@ import android.graphics.Rect; import android.graphics.Typeface; import android.util.SparseArray; -import com.android.inputmethod.latin.CollectionUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; public final class TypefaceUtils { private TypefaceUtils() { diff --git a/java/src/com/android/inputmethod/keyboard/internal/GestureFloatingPreviewText.java b/java/src/com/android/inputmethod/keyboard/internal/GestureFloatingPreviewText.java index ab810a580..9bfddba42 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/GestureFloatingPreviewText.java +++ b/java/src/com/android/inputmethod/keyboard/internal/GestureFloatingPreviewText.java @@ -26,9 +26,9 @@ import android.text.TextUtils; import android.view.View; import com.android.inputmethod.keyboard.PointerTracker; -import com.android.inputmethod.latin.CoordinateUtils; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.SuggestedWords; +import com.android.inputmethod.latin.utils.CoordinateUtils; /** * The class for single gesture preview text. The class for multiple gesture preview text will be diff --git a/java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java b/java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java index 70363e602..f29ade861 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java +++ b/java/src/com/android/inputmethod/keyboard/internal/GestureStroke.java @@ -21,8 +21,8 @@ import android.util.Log; import com.android.inputmethod.latin.InputPointers; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResizableIntArray; -import com.android.inputmethod.latin.ResourceUtils; +import com.android.inputmethod.latin.utils.ResizableIntArray; +import com.android.inputmethod.latin.utils.ResourceUtils; public class GestureStroke { private static final String TAG = GestureStroke.class.getSimpleName(); diff --git a/java/src/com/android/inputmethod/keyboard/internal/GestureStrokeWithPreviewPoints.java b/java/src/com/android/inputmethod/keyboard/internal/GestureStrokeWithPreviewPoints.java index 8deadbf96..ecc67dd44 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/GestureStrokeWithPreviewPoints.java +++ b/java/src/com/android/inputmethod/keyboard/internal/GestureStrokeWithPreviewPoints.java @@ -19,7 +19,7 @@ package com.android.inputmethod.keyboard.internal; import android.content.res.TypedArray; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResizableIntArray; +import com.android.inputmethod.latin.utils.ResizableIntArray; public final class GestureStrokeWithPreviewPoints extends GestureStroke { public static final int PREVIEW_CAPACITY = 256; diff --git a/java/src/com/android/inputmethod/keyboard/internal/GestureTrail.java b/java/src/com/android/inputmethod/keyboard/internal/GestureTrail.java index fb69e22e7..aca667919 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/GestureTrail.java +++ b/java/src/com/android/inputmethod/keyboard/internal/GestureTrail.java @@ -26,7 +26,7 @@ import android.os.SystemClock; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResizableIntArray; +import com.android.inputmethod.latin.utils.ResizableIntArray; /* * @attr ref R.styleable#MainKeyboardView_gestureTrailFadeoutStartDelay diff --git a/java/src/com/android/inputmethod/keyboard/internal/GestureTrailsPreview.java b/java/src/com/android/inputmethod/keyboard/internal/GestureTrailsPreview.java index 1e4c43ee5..dff5177ce 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/GestureTrailsPreview.java +++ b/java/src/com/android/inputmethod/keyboard/internal/GestureTrailsPreview.java @@ -30,8 +30,8 @@ import android.view.View; import com.android.inputmethod.keyboard.PointerTracker; import com.android.inputmethod.keyboard.internal.GestureTrail.Params; -import com.android.inputmethod.latin.CollectionUtils; -import com.android.inputmethod.latin.StaticInnerHandlerWrapper; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.StaticInnerHandlerWrapper; /** * Draw gesture trail preview graphics during gesture. diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java b/java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java index 5dcd842f7..1716fa049 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java @@ -18,7 +18,7 @@ package com.android.inputmethod.keyboard.internal; import android.graphics.Typeface; -import com.android.inputmethod.latin.ResourceUtils; +import com.android.inputmethod.latin.utils.ResourceUtils; public final class KeyDrawParams { public Typeface mTypeface; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java index ba449eeb3..22f5b3dd1 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeySpecParser.java @@ -21,10 +21,10 @@ import static com.android.inputmethod.latin.Constants.CODE_UNSPECIFIED; import android.text.TextUtils; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.LatinImeLogger; -import com.android.inputmethod.latin.StringUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.StringUtils; import java.util.ArrayList; import java.util.Arrays; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyStylesSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyStylesSet.java index a048ad09f..6aab3e7b3 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyStylesSet.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyStylesSet.java @@ -20,9 +20,9 @@ import android.content.res.TypedArray; import android.util.Log; import android.util.SparseArray; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.XmlParseUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.XmlParseUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java b/java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java index 6ddd2a6fb..7a2622cbb 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java @@ -21,7 +21,7 @@ import android.graphics.Typeface; import android.util.SparseIntArray; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResourceUtils; +import com.android.inputmethod.latin.utils.ResourceUtils; public final class KeyVisualAttributes { public final Typeface mTypeface; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java index be178f516..26bbd7de9 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java @@ -29,12 +29,12 @@ import com.android.inputmethod.annotations.UsedForTesting; import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.keyboard.KeyboardId; -import com.android.inputmethod.latin.LocaleUtils.RunInLocale; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResourceUtils; -import com.android.inputmethod.latin.StringUtils; import com.android.inputmethod.latin.SubtypeLocale; -import com.android.inputmethod.latin.XmlParseUtils; +import com.android.inputmethod.latin.utils.LocaleUtils.RunInLocale; +import com.android.inputmethod.latin.utils.ResourceUtils; +import com.android.inputmethod.latin.utils.StringUtils; +import com.android.inputmethod.latin.utils.XmlParseUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java index a9e04bccf..d65aae2dc 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardCodesSet.java @@ -16,8 +16,8 @@ package com.android.inputmethod.keyboard.internal; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.Constants; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.HashMap; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java index 4ac2549c7..4e3f7618b 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardIconsSet.java @@ -22,8 +22,8 @@ import android.graphics.drawable.Drawable; import android.util.Log; import android.util.SparseIntArray; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.HashMap; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardParams.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardParams.java index 84319eb33..a57b83ac0 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardParams.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardParams.java @@ -20,8 +20,8 @@ import android.util.SparseIntArray; import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.KeyboardId; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.Constants; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.ArrayList; import java.util.TreeSet; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardRow.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardRow.java index 855f65507..5fe84a704 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardRow.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardRow.java @@ -23,7 +23,7 @@ import android.util.Xml; import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResourceUtils; +import com.android.inputmethod.latin.utils.ResourceUtils; import org.xmlpull.v1.XmlPullParser; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index e1cee427e..370d0cb93 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -20,7 +20,7 @@ import android.text.TextUtils; import android.util.Log; import com.android.inputmethod.latin.Constants; -import com.android.inputmethod.latin.RecapitalizeStatus; +import com.android.inputmethod.latin.utils.RecapitalizeStatus; /** * Keyboard state machine. diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java index 7ec1c9406..467c15ffd 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsSet.java @@ -20,7 +20,7 @@ import android.content.Context; import android.content.res.Resources; import com.android.inputmethod.annotations.UsedForTesting; -import com.android.inputmethod.latin.CollectionUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.HashMap; diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeysCache.java b/java/src/com/android/inputmethod/keyboard/internal/KeysCache.java index db154a391..7c2e3e174 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeysCache.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeysCache.java @@ -17,7 +17,7 @@ package com.android.inputmethod.keyboard.internal; import com.android.inputmethod.keyboard.Key; -import com.android.inputmethod.latin.CollectionUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.HashMap; diff --git a/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpec.java b/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpec.java index b38d79f7b..110936f8f 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpec.java +++ b/java/src/com/android/inputmethod/keyboard/internal/MoreKeySpec.java @@ -19,7 +19,7 @@ package com.android.inputmethod.keyboard.internal; import android.text.TextUtils; import com.android.inputmethod.latin.Constants; -import com.android.inputmethod.latin.StringUtils; +import com.android.inputmethod.latin.utils.StringUtils; import java.util.Locale; diff --git a/java/src/com/android/inputmethod/keyboard/internal/PointerTrackerQueue.java b/java/src/com/android/inputmethod/keyboard/internal/PointerTrackerQueue.java index 31ef3cd8f..3dbb7b7e9 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/PointerTrackerQueue.java +++ b/java/src/com/android/inputmethod/keyboard/internal/PointerTrackerQueue.java @@ -18,7 +18,7 @@ package com.android.inputmethod.keyboard.internal; import android.util.Log; -import com.android.inputmethod.latin.CollectionUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/keyboard/internal/PreviewPlacerView.java b/java/src/com/android/inputmethod/keyboard/internal/PreviewPlacerView.java index 23761103f..3388c5701 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/PreviewPlacerView.java +++ b/java/src/com/android/inputmethod/keyboard/internal/PreviewPlacerView.java @@ -24,8 +24,8 @@ import android.graphics.PorterDuffXfermode; import android.util.AttributeSet; import android.widget.RelativeLayout; -import com.android.inputmethod.latin.CollectionUtils; -import com.android.inputmethod.latin.CoordinateUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.CoordinateUtils; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/keyboard/internal/SlidingKeyInputPreview.java b/java/src/com/android/inputmethod/keyboard/internal/SlidingKeyInputPreview.java index 33dbbafa3..5c9d36702 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/SlidingKeyInputPreview.java +++ b/java/src/com/android/inputmethod/keyboard/internal/SlidingKeyInputPreview.java @@ -23,8 +23,8 @@ import android.graphics.Path; import android.view.View; import com.android.inputmethod.keyboard.PointerTracker; -import com.android.inputmethod.latin.CoordinateUtils; import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.utils.CoordinateUtils; /** * Draw rubber band preview graphics during sliding key input. diff --git a/java/src/com/android/inputmethod/keyboard/internal/TouchScreenRegulator.java b/java/src/com/android/inputmethod/keyboard/internal/TouchScreenRegulator.java index d6b1cc6fc..fddd9856e 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/TouchScreenRegulator.java +++ b/java/src/com/android/inputmethod/keyboard/internal/TouchScreenRegulator.java @@ -23,8 +23,8 @@ import android.view.MotionEvent; import com.android.inputmethod.keyboard.MainKeyboardView; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResourceUtils; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.latin.utils.ResourceUtils; import com.android.inputmethod.research.ResearchLogger; public final class TouchScreenRegulator { diff --git a/java/src/com/android/inputmethod/latin/AdditionalSubtype.java b/java/src/com/android/inputmethod/latin/AdditionalSubtype.java index 85b14d849..0bddeb5ce 100644 --- a/java/src/com/android/inputmethod/latin/AdditionalSubtype.java +++ b/java/src/com/android/inputmethod/latin/AdditionalSubtype.java @@ -25,6 +25,9 @@ import android.os.Build; import android.text.TextUtils; import android.view.inputmethod.InputMethodSubtype; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.StringUtils; + import java.util.ArrayList; public final class AdditionalSubtype { diff --git a/java/src/com/android/inputmethod/latin/AdditionalSubtypeSettings.java b/java/src/com/android/inputmethod/latin/AdditionalSubtypeSettings.java index ff5e33949..8128e3a17 100644 --- a/java/src/com/android/inputmethod/latin/AdditionalSubtypeSettings.java +++ b/java/src/com/android/inputmethod/latin/AdditionalSubtypeSettings.java @@ -44,6 +44,9 @@ import android.widget.Spinner; import android.widget.SpinnerAdapter; import android.widget.Toast; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.IntentUtils; + import java.util.ArrayList; import java.util.TreeSet; diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index aad129d76..05b1a2ee1 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -21,6 +21,10 @@ import android.util.SparseArray; import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; +import com.android.inputmethod.latin.utils.AdditionalFeaturesSettingUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.JniUtils; +import com.android.inputmethod.latin.utils.StringUtils; import java.util.ArrayList; import java.util.Arrays; diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java index c038db87c..321e80611 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java @@ -28,7 +28,10 @@ import android.text.TextUtils; import android.util.Log; import com.android.inputmethod.dictionarypack.DictionaryPackConstants; -import com.android.inputmethod.latin.DictionaryInfoUtils.DictionaryInfo; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.DictionaryInfoUtils; +import com.android.inputmethod.latin.utils.DictionaryInfoUtils.DictionaryInfo; +import com.android.inputmethod.latin.utils.MetadataFileUriGetter; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java index 272f36e4f..d0af59db0 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java @@ -16,10 +16,6 @@ package com.android.inputmethod.latin; -import com.android.inputmethod.latin.define.ProductionFlag; -import com.android.inputmethod.latin.makedict.BinaryDictInputOutput; -import com.android.inputmethod.latin.makedict.FormatSpec; - import android.content.Context; import android.content.SharedPreferences; import android.content.pm.PackageManager; @@ -27,6 +23,13 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.AssetFileDescriptor; import android.util.Log; +import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.latin.makedict.BinaryDictInputOutput; +import com.android.inputmethod.latin.makedict.FormatSpec; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.DictionaryInfoUtils; +import com.android.inputmethod.latin.utils.LocaleUtils; + import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -39,7 +42,7 @@ import java.util.Locale; /** * Helper class to get the address of a mmap'able dictionary file. */ -final class BinaryDictionaryGetter { +final public class BinaryDictionaryGetter { /** * Used for Log actions from this class diff --git a/java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java index b9db9a092..110be9db3 100644 --- a/java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/ContactsBinaryDictionary.java @@ -30,6 +30,8 @@ import android.provider.ContactsContract.Contacts; import android.text.TextUtils; import android.util.Log; +import com.android.inputmethod.latin.utils.StringUtils; + import java.util.List; import java.util.Locale; diff --git a/java/src/com/android/inputmethod/latin/DebugSettings.java b/java/src/com/android/inputmethod/latin/DebugSettings.java index 5969a63de..d1cb39cd9 100644 --- a/java/src/com/android/inputmethod/latin/DebugSettings.java +++ b/java/src/com/android/inputmethod/latin/DebugSettings.java @@ -29,6 +29,7 @@ import android.preference.PreferenceScreen; import android.util.Log; import com.android.inputmethod.keyboard.KeyboardSwitcher; +import com.android.inputmethod.latin.utils.Utils; import com.android.inputmethod.research.ResearchLogger; public final class DebugSettings extends PreferenceFragment diff --git a/java/src/com/android/inputmethod/latin/DicTraverseSession.java b/java/src/com/android/inputmethod/latin/DicTraverseSession.java index 534e2116b..45b281318 100644 --- a/java/src/com/android/inputmethod/latin/DicTraverseSession.java +++ b/java/src/com/android/inputmethod/latin/DicTraverseSession.java @@ -16,6 +16,8 @@ package com.android.inputmethod.latin; +import com.android.inputmethod.latin.utils.JniUtils; + import java.util.Locale; public final class DicTraverseSession { diff --git a/java/src/com/android/inputmethod/latin/DictionaryCollection.java b/java/src/com/android/inputmethod/latin/DictionaryCollection.java index ed2b44223..d05bb1e55 100644 --- a/java/src/com/android/inputmethod/latin/DictionaryCollection.java +++ b/java/src/com/android/inputmethod/latin/DictionaryCollection.java @@ -16,10 +16,11 @@ package com.android.inputmethod.latin; +import android.util.Log; + import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; - -import android.util.Log; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.ArrayList; import java.util.Collection; diff --git a/java/src/com/android/inputmethod/latin/DictionaryFactory.java b/java/src/com/android/inputmethod/latin/DictionaryFactory.java index 4514ec2ec..5b98613a4 100644 --- a/java/src/com/android/inputmethod/latin/DictionaryFactory.java +++ b/java/src/com/android/inputmethod/latin/DictionaryFactory.java @@ -22,6 +22,8 @@ import android.content.res.Resources; import android.util.Log; import com.android.inputmethod.annotations.UsedForTesting; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.DictionaryInfoUtils; import java.io.File; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/latin/DictionaryPackInstallBroadcastReceiver.java b/java/src/com/android/inputmethod/latin/DictionaryPackInstallBroadcastReceiver.java index 56096127e..2dcfdb0b7 100644 --- a/java/src/com/android/inputmethod/latin/DictionaryPackInstallBroadcastReceiver.java +++ b/java/src/com/android/inputmethod/latin/DictionaryPackInstallBroadcastReceiver.java @@ -17,6 +17,7 @@ package com.android.inputmethod.latin; import com.android.inputmethod.dictionarypack.DictionaryPackConstants; +import com.android.inputmethod.latin.utils.TargetPackageInfoGetterTask; import android.content.BroadcastReceiver; import android.content.Context; diff --git a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java index 887d657e9..f357e2a1e 100644 --- a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java @@ -28,6 +28,7 @@ import com.android.inputmethod.latin.makedict.FusionDictionary; import com.android.inputmethod.latin.makedict.FusionDictionary.Node; import com.android.inputmethod.latin.makedict.FusionDictionary.WeightedString; import com.android.inputmethod.latin.makedict.UnsupportedFormatException; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.io.File; import java.io.FileOutputStream; diff --git a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java index 0dabdb835..a67c919b3 100644 --- a/java/src/com/android/inputmethod/latin/ExpandableDictionary.java +++ b/java/src/com/android/inputmethod/latin/ExpandableDictionary.java @@ -22,7 +22,8 @@ import android.util.Log; import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; -import com.android.inputmethod.latin.UserHistoryForgettingCurveUtils.ForgettingCurveParams; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.UserHistoryForgettingCurveUtils.ForgettingCurveParams; import java.util.ArrayList; import java.util.LinkedList; diff --git a/java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java b/java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java index 9f91639a2..18f4920d9 100644 --- a/java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java +++ b/java/src/com/android/inputmethod/latin/ExternalDictionaryGetterForDebug.java @@ -23,6 +23,9 @@ import android.content.DialogInterface.OnClickListener; import android.os.Environment; import com.android.inputmethod.latin.makedict.FormatSpec.FileHeader; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.DictionaryInfoUtils; +import com.android.inputmethod.latin.utils.LocaleUtils; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; diff --git a/java/src/com/android/inputmethod/latin/InputAttributes.java b/java/src/com/android/inputmethod/latin/InputAttributes.java index 1f673e9b0..21b103e5a 100644 --- a/java/src/com/android/inputmethod/latin/InputAttributes.java +++ b/java/src/com/android/inputmethod/latin/InputAttributes.java @@ -20,6 +20,9 @@ import android.text.InputType; import android.util.Log; import android.view.inputmethod.EditorInfo; +import com.android.inputmethod.latin.utils.InputTypeUtils; +import com.android.inputmethod.latin.utils.StringUtils; + /** * Class to hold attributes of the input field. */ diff --git a/java/src/com/android/inputmethod/latin/InputPointers.java b/java/src/com/android/inputmethod/latin/InputPointers.java index 81c833000..e96a46e12 100644 --- a/java/src/com/android/inputmethod/latin/InputPointers.java +++ b/java/src/com/android/inputmethod/latin/InputPointers.java @@ -17,6 +17,7 @@ package com.android.inputmethod.latin; import com.android.inputmethod.annotations.UsedForTesting; +import com.android.inputmethod.latin.utils.ResizableIntArray; import android.util.Log; diff --git a/java/src/com/android/inputmethod/latin/LastComposedWord.java b/java/src/com/android/inputmethod/latin/LastComposedWord.java index 826dc11e7..cdeadc74f 100644 --- a/java/src/com/android/inputmethod/latin/LastComposedWord.java +++ b/java/src/com/android/inputmethod/latin/LastComposedWord.java @@ -16,6 +16,8 @@ package com.android.inputmethod.latin; +import com.android.inputmethod.latin.utils.StringUtils; + import android.text.TextUtils; /** diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 52a9b9a6c..6689e50a4 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -76,9 +76,19 @@ import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.keyboard.MainKeyboardView; import com.android.inputmethod.latin.RichInputConnection.Range; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; -import com.android.inputmethod.latin.Utils.Stats; import com.android.inputmethod.latin.define.ProductionFlag; import com.android.inputmethod.latin.suggestions.SuggestionStripView; +import com.android.inputmethod.latin.utils.CapsModeUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.CompletionInfoUtils; +import com.android.inputmethod.latin.utils.InputTypeUtils; +import com.android.inputmethod.latin.utils.IntentUtils; +import com.android.inputmethod.latin.utils.PositionalInfoForUserDictPendingAddition; +import com.android.inputmethod.latin.utils.RecapitalizeStatus; +import com.android.inputmethod.latin.utils.StaticInnerHandlerWrapper; +import com.android.inputmethod.latin.utils.TargetPackageInfoGetterTask; +import com.android.inputmethod.latin.utils.Utils; +import com.android.inputmethod.latin.utils.Utils.Stats; import com.android.inputmethod.research.ResearchLogger; import java.io.FileDescriptor; diff --git a/java/src/com/android/inputmethod/latin/NativeSuggestOptions.java b/java/src/com/android/inputmethod/latin/NativeSuggestOptions.java index 291551301..07ccd75e6 100644 --- a/java/src/com/android/inputmethod/latin/NativeSuggestOptions.java +++ b/java/src/com/android/inputmethod/latin/NativeSuggestOptions.java @@ -16,6 +16,8 @@ package com.android.inputmethod.latin; +import com.android.inputmethod.latin.utils.AdditionalFeaturesSettingUtils; + public class NativeSuggestOptions { // Need to update suggest_options.h when you add, remove or reorder options. private static final int IS_GESTURE = 0; diff --git a/java/src/com/android/inputmethod/latin/RichInputConnection.java b/java/src/com/android/inputmethod/latin/RichInputConnection.java index 980215de6..be7f93c72 100644 --- a/java/src/com/android/inputmethod/latin/RichInputConnection.java +++ b/java/src/com/android/inputmethod/latin/RichInputConnection.java @@ -28,6 +28,9 @@ import android.view.inputmethod.ExtractedTextRequest; import android.view.inputmethod.InputConnection; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.latin.utils.CapsModeUtils; +import com.android.inputmethod.latin.utils.LogUtils; +import com.android.inputmethod.latin.utils.StringUtils; import com.android.inputmethod.research.ResearchLogger; import java.util.Locale; @@ -105,7 +108,7 @@ public final class RichInputConnection { + "\nActual text = " + reference.length() + " " + reference; ((LatinIME)mParent).debugDumpStateAndCrashWithException(context); } else { - Log.e(TAG, Utils.getStackTrace(2)); + Log.e(TAG, LogUtils.getStackTrace(2)); Log.e(TAG, "Exp <> Actual : " + mCurrentCursorPosition + " <> " + et.selectionStart); } } @@ -154,7 +157,7 @@ public final class RichInputConnection { if (mNestLevel != 1) { // TODO: exception instead Log.e(TAG, "Batch edit level incorrect : " + mNestLevel); - Log.e(TAG, Utils.getStackTrace(4)); + Log.e(TAG, LogUtils.getStackTrace(4)); } } diff --git a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java index 86f75635d..5b1a2dde4 100644 --- a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java +++ b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java @@ -28,6 +28,7 @@ import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodSubtype; import com.android.inputmethod.compat.InputMethodManagerCompatWrapper; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.Collections; import java.util.HashMap; diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index a6149c6ec..084d3308c 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -23,7 +23,9 @@ import android.content.res.Resources; import android.preference.PreferenceManager; import android.util.Log; -import com.android.inputmethod.latin.LocaleUtils.RunInLocale; +import com.android.inputmethod.latin.utils.LocaleUtils; +import com.android.inputmethod.latin.utils.LocaleUtils.RunInLocale; +import com.android.inputmethod.latin.utils.ResourceUtils; import java.util.HashMap; import java.util.Locale; diff --git a/java/src/com/android/inputmethod/latin/SettingsFragment.java b/java/src/com/android/inputmethod/latin/SettingsFragment.java index 8017ce161..46fa1913c 100644 --- a/java/src/com/android/inputmethod/latin/SettingsFragment.java +++ b/java/src/com/android/inputmethod/latin/SettingsFragment.java @@ -35,16 +35,19 @@ import android.preference.PreferenceScreen; import android.util.Log; import android.view.inputmethod.InputMethodSubtype; -import java.util.TreeSet; - import com.android.inputmethod.dictionarypack.DictionarySettingsActivity; import com.android.inputmethod.latin.define.ProductionFlag; import com.android.inputmethod.latin.setup.LauncherIconVisibilityManager; import com.android.inputmethod.latin.userdictionary.UserDictionaryList; import com.android.inputmethod.latin.userdictionary.UserDictionarySettings; +import com.android.inputmethod.latin.utils.AdditionalFeaturesSettingUtils; +import com.android.inputmethod.latin.utils.FeedbackUtils; +import com.android.inputmethod.latin.utils.Utils; import com.android.inputmethod.research.ResearchLogger; import com.android.inputmethodcommon.InputMethodSettingsFragment; +import java.util.TreeSet; + public final class SettingsFragment extends InputMethodSettingsFragment implements SharedPreferences.OnSharedPreferenceChangeListener { private static final String TAG = SettingsFragment.class.getSimpleName(); diff --git a/java/src/com/android/inputmethod/latin/SettingsValues.java b/java/src/com/android/inputmethod/latin/SettingsValues.java index 09102447f..8eadf73b2 100644 --- a/java/src/com/android/inputmethod/latin/SettingsValues.java +++ b/java/src/com/android/inputmethod/latin/SettingsValues.java @@ -24,6 +24,10 @@ import android.view.inputmethod.EditorInfo; import com.android.inputmethod.keyboard.internal.KeySpecParser; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; +import com.android.inputmethod.latin.utils.AdditionalFeaturesSettingUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.InputTypeUtils; +import com.android.inputmethod.latin.utils.StringUtils; import java.util.ArrayList; import java.util.Arrays; diff --git a/java/src/com/android/inputmethod/latin/SubtypeLocale.java b/java/src/com/android/inputmethod/latin/SubtypeLocale.java index 4d88ecc0c..3f94aca3a 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeLocale.java +++ b/java/src/com/android/inputmethod/latin/SubtypeLocale.java @@ -25,7 +25,11 @@ import android.os.Build; import android.util.Log; import android.view.inputmethod.InputMethodSubtype; -import com.android.inputmethod.latin.LocaleUtils.RunInLocale; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.LocaleUtils; +import com.android.inputmethod.latin.utils.LocaleUtils.RunInLocale; +import com.android.inputmethod.latin.utils.LogUtils; +import com.android.inputmethod.latin.utils.StringUtils; import java.util.HashMap; import java.util.Locale; @@ -238,7 +242,7 @@ public final class SubtypeLocale { + " nameResId=" + subtype.getNameResId() + " locale=" + subtype.getLocale() + " extra=" + subtype.getExtraValue() - + "\n" + Utils.getStackTrace()); + + "\n" + LogUtils.getStackTrace()); return ""; } } diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index e783e6d51..8b31f4e99 100644 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -22,6 +22,9 @@ import android.text.TextUtils; import com.android.inputmethod.annotations.UsedForTesting; import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; +import com.android.inputmethod.latin.utils.BoundedTreeSet; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.StringUtils; import java.util.ArrayList; import java.util.Comparator; diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java index 7a16595a7..5b47dda0d 100644 --- a/java/src/com/android/inputmethod/latin/SuggestedWords.java +++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java @@ -19,6 +19,9 @@ package com.android.inputmethod.latin; import android.text.TextUtils; import android.view.inputmethod.CompletionInfo; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.StringUtils; + import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; diff --git a/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java b/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java index 90f92972a..ba84c1ad3 100644 --- a/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/UserBinaryDictionary.java @@ -28,6 +28,7 @@ import android.provider.UserDictionary.Words; import android.text.TextUtils; import com.android.inputmethod.compat.UserDictionaryCompatUtils; +import com.android.inputmethod.latin.utils.LocaleUtils; import java.util.Arrays; import java.util.Locale; diff --git a/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java b/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java index ab5724724..ca2d8840b 100644 --- a/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java +++ b/java/src/com/android/inputmethod/latin/UserHistoryDictionary.java @@ -24,10 +24,13 @@ import android.util.Log; import com.android.inputmethod.annotations.UsedForTesting; import com.android.inputmethod.keyboard.ProximityInfo; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; -import com.android.inputmethod.latin.UserHistoryDictIOUtils.BigramDictionaryInterface; -import com.android.inputmethod.latin.UserHistoryDictIOUtils.OnAddWordListener; -import com.android.inputmethod.latin.UserHistoryForgettingCurveUtils.ForgettingCurveParams; import com.android.inputmethod.latin.makedict.FormatSpec.FormatOptions; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.UserHistoryDictIOUtils; +import com.android.inputmethod.latin.utils.UserHistoryDictIOUtils.BigramDictionaryInterface; +import com.android.inputmethod.latin.utils.UserHistoryDictIOUtils.OnAddWordListener; +import com.android.inputmethod.latin.utils.UserHistoryForgettingCurveUtils; +import com.android.inputmethod.latin.utils.UserHistoryForgettingCurveUtils.ForgettingCurveParams; import java.io.File; import java.io.FileInputStream; diff --git a/java/src/com/android/inputmethod/latin/UserHistoryDictionaryBigramList.java b/java/src/com/android/inputmethod/latin/UserHistoryDictionaryBigramList.java index 316f09603..28941c4a1 100644 --- a/java/src/com/android/inputmethod/latin/UserHistoryDictionaryBigramList.java +++ b/java/src/com/android/inputmethod/latin/UserHistoryDictionaryBigramList.java @@ -19,6 +19,7 @@ package com.android.inputmethod.latin; import android.util.Log; import com.android.inputmethod.annotations.UsedForTesting; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.HashMap; import java.util.Set; diff --git a/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java b/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java index 13fa9d9c8..978c0642d 100644 --- a/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java +++ b/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java @@ -35,10 +35,10 @@ import android.widget.VideoView; import com.android.inputmethod.compat.TextViewCompatUtils; import com.android.inputmethod.compat.ViewCompatUtils; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.SettingsActivity; -import com.android.inputmethod.latin.StaticInnerHandlerWrapper; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.StaticInnerHandlerWrapper; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java index 13fcaf48a..692e7392c 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerService.java @@ -25,17 +25,17 @@ import android.view.textservice.SuggestionsInfo; import com.android.inputmethod.keyboard.KeyboardLayoutSet; import com.android.inputmethod.latin.BinaryDictionary; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.ContactsBinaryDictionary; import com.android.inputmethod.latin.Dictionary; import com.android.inputmethod.latin.DictionaryCollection; import com.android.inputmethod.latin.DictionaryFactory; -import com.android.inputmethod.latin.LocaleUtils; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.StringUtils; import com.android.inputmethod.latin.SynchronouslyLoadedContactsBinaryDictionary; import com.android.inputmethod.latin.SynchronouslyLoadedUserBinaryDictionary; import com.android.inputmethod.latin.UserBinaryDictionary; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.LocaleUtils; +import com.android.inputmethod.latin.utils.StringUtils; import java.lang.ref.WeakReference; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java index 9a1114f7f..ddda52d71 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidSpellCheckerSession.java @@ -23,7 +23,7 @@ import android.view.textservice.SentenceSuggestionsInfo; import android.view.textservice.SuggestionsInfo; import android.view.textservice.TextInfo; -import com.android.inputmethod.latin.CollectionUtils; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java index 16e9fb77e..6719e98da 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/AndroidWordLevelSpellCheckerSession.java @@ -30,11 +30,11 @@ import android.view.textservice.TextInfo; import com.android.inputmethod.compat.SuggestionsInfoCompatUtils; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.Dictionary; -import com.android.inputmethod.latin.LocaleUtils; -import com.android.inputmethod.latin.StringUtils; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.WordComposer; import com.android.inputmethod.latin.spellcheck.AndroidSpellCheckerService.SuggestionsGatherer; +import com.android.inputmethod.latin.utils.LocaleUtils; +import com.android.inputmethod.latin.utils.StringUtils; import java.util.ArrayList; import java.util.Locale; diff --git a/java/src/com/android/inputmethod/latin/spellcheck/DictionaryPool.java b/java/src/com/android/inputmethod/latin/spellcheck/DictionaryPool.java index a20e09ee8..ac8f68781 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/DictionaryPool.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/DictionaryPool.java @@ -19,10 +19,10 @@ package com.android.inputmethod.latin.spellcheck; import android.util.Log; import com.android.inputmethod.keyboard.ProximityInfo; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.Dictionary; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.WordComposer; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.util.ArrayList; import java.util.Locale; diff --git a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsFragment.java b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsFragment.java index 5ce9d8e47..da5812603 100644 --- a/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsFragment.java +++ b/java/src/com/android/inputmethod/latin/spellcheck/SpellCheckerSettingsFragment.java @@ -21,7 +21,7 @@ import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.Utils; +import com.android.inputmethod.latin.utils.Utils; /** * Preference screen. diff --git a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java index 322ae5b0f..2218b3bc6 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java +++ b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java @@ -31,7 +31,7 @@ import com.android.inputmethod.keyboard.internal.KeyboardParams; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; -import com.android.inputmethod.latin.Utils; +import com.android.inputmethod.latin.utils.Utils; public final class MoreSuggestions extends Keyboard { public static final int SUGGESTION_CODE_BASE = 1024; diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java index 916f483b9..b6caf9b7b 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java @@ -49,9 +49,9 @@ import com.android.inputmethod.keyboard.ViewLayoutUtils; import com.android.inputmethod.latin.AutoCorrection; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.ResourceUtils; import com.android.inputmethod.latin.SuggestedWords; -import com.android.inputmethod.latin.Utils; +import com.android.inputmethod.latin.utils.ResourceUtils; +import com.android.inputmethod.latin.utils.Utils; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java index 2284a4607..fcebdd457 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java @@ -34,7 +34,6 @@ import com.android.inputmethod.keyboard.KeyboardSwitcher; import com.android.inputmethod.keyboard.MainKeyboardView; import com.android.inputmethod.keyboard.MoreKeysPanel; import com.android.inputmethod.latin.AudioAndHapticFeedbackManager; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; @@ -42,6 +41,7 @@ import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.define.ProductionFlag; import com.android.inputmethod.latin.suggestions.MoreSuggestions.MoreSuggestionsListener; +import com.android.inputmethod.latin.utils.CollectionUtils; import com.android.inputmethod.research.ResearchLogger; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java index 89ec7466e..dad72963d 100644 --- a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java +++ b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryAddWordContents.java @@ -16,10 +16,6 @@ package com.android.inputmethod.latin.userdictionary; -import com.android.inputmethod.compat.UserDictionaryCompatUtils; -import com.android.inputmethod.latin.LocaleUtils; -import com.android.inputmethod.latin.R; - import android.app.Activity; import android.content.ContentResolver; import android.content.Context; @@ -30,6 +26,10 @@ import android.text.TextUtils; import android.view.View; import android.widget.EditText; +import com.android.inputmethod.compat.UserDictionaryCompatUtils; +import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.utils.LocaleUtils; + import java.util.ArrayList; import java.util.Locale; import java.util.TreeSet; diff --git a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java index 6e64882b6..e7cf0d3af 100644 --- a/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java +++ b/java/src/com/android/inputmethod/latin/userdictionary/UserDictionaryList.java @@ -16,9 +16,6 @@ package com.android.inputmethod.latin.userdictionary; -import com.android.inputmethod.latin.LocaleUtils; -import com.android.inputmethod.latin.R; - import android.app.Activity; import android.content.Intent; import android.database.Cursor; @@ -29,6 +26,9 @@ import android.preference.PreferenceGroup; import android.provider.UserDictionary; import android.text.TextUtils; +import com.android.inputmethod.latin.R; +import com.android.inputmethod.latin.utils.LocaleUtils; + import java.util.Locale; import java.util.TreeSet; diff --git a/java/src/com/android/inputmethod/latin/AdditionalFeaturesSettingUtils.java b/java/src/com/android/inputmethod/latin/utils/AdditionalFeaturesSettingUtils.java similarity index 94% rename from java/src/com/android/inputmethod/latin/AdditionalFeaturesSettingUtils.java rename to java/src/com/android/inputmethod/latin/utils/AdditionalFeaturesSettingUtils.java index 0fdaea50c..18dfb3dba 100644 --- a/java/src/com/android/inputmethod/latin/AdditionalFeaturesSettingUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/AdditionalFeaturesSettingUtils.java @@ -14,13 +14,14 @@ * limitations under the License. */ -package com.android.inputmethod.latin; - -import com.android.inputmethodcommon.InputMethodSettingsFragment; +package com.android.inputmethod.latin.utils; import android.content.Context; import android.content.SharedPreferences; +import com.android.inputmethod.latin.Settings; +import com.android.inputmethodcommon.InputMethodSettingsFragment; + /** * Utility class for managing additional features settings. */ diff --git a/java/src/com/android/inputmethod/latin/BoundedTreeSet.java b/java/src/com/android/inputmethod/latin/utils/BoundedTreeSet.java similarity index 97% rename from java/src/com/android/inputmethod/latin/BoundedTreeSet.java rename to java/src/com/android/inputmethod/latin/utils/BoundedTreeSet.java index 489a74ef1..ae1fd3f79 100644 --- a/java/src/com/android/inputmethod/latin/BoundedTreeSet.java +++ b/java/src/com/android/inputmethod/latin/utils/BoundedTreeSet.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; diff --git a/java/src/com/android/inputmethod/latin/CapsModeUtils.java b/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java similarity index 98% rename from java/src/com/android/inputmethod/latin/CapsModeUtils.java rename to java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java index 4b8d1ac11..2f91c5743 100644 --- a/java/src/com/android/inputmethod/latin/CapsModeUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java @@ -14,11 +14,14 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.text.InputType; import android.text.TextUtils; +import com.android.inputmethod.latin.Constants; +import com.android.inputmethod.latin.WordComposer; + import java.util.Locale; public final class CapsModeUtils { diff --git a/java/src/com/android/inputmethod/latin/CollectionUtils.java b/java/src/com/android/inputmethod/latin/utils/CollectionUtils.java similarity index 98% rename from java/src/com/android/inputmethod/latin/CollectionUtils.java rename to java/src/com/android/inputmethod/latin/utils/CollectionUtils.java index a8623cc63..98f0d8b68 100644 --- a/java/src/com/android/inputmethod/latin/CollectionUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/CollectionUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.util.SparseArray; diff --git a/java/src/com/android/inputmethod/latin/CompletionInfoUtils.java b/java/src/com/android/inputmethod/latin/utils/CompletionInfoUtils.java similarity index 96% rename from java/src/com/android/inputmethod/latin/CompletionInfoUtils.java rename to java/src/com/android/inputmethod/latin/utils/CompletionInfoUtils.java index 792a446c9..5ccf0e079 100644 --- a/java/src/com/android/inputmethod/latin/CompletionInfoUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/CompletionInfoUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.text.TextUtils; import android.view.inputmethod.CompletionInfo; diff --git a/java/src/com/android/inputmethod/latin/CoordinateUtils.java b/java/src/com/android/inputmethod/latin/utils/CoordinateUtils.java similarity index 97% rename from java/src/com/android/inputmethod/latin/CoordinateUtils.java rename to java/src/com/android/inputmethod/latin/utils/CoordinateUtils.java index af270e1e4..72f2cd2d9 100644 --- a/java/src/com/android/inputmethod/latin/CoordinateUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/CoordinateUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; public final class CoordinateUtils { private static final int INDEX_X = 0; diff --git a/java/src/com/android/inputmethod/latin/utils/CsvUtils.java b/java/src/com/android/inputmethod/latin/utils/CsvUtils.java index 999c2f0de..159ebb1b9 100644 --- a/java/src/com/android/inputmethod/latin/utils/CsvUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/CsvUtils.java @@ -17,7 +17,6 @@ package com.android.inputmethod.latin.utils; import com.android.inputmethod.annotations.UsedForTesting; -import com.android.inputmethod.latin.CollectionUtils; import java.util.ArrayList; diff --git a/java/src/com/android/inputmethod/latin/DictionaryInfoUtils.java b/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java similarity index 98% rename from java/src/com/android/inputmethod/latin/DictionaryInfoUtils.java rename to java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java index 9d478491a..b3d37d78c 100644 --- a/java/src/com/android/inputmethod/latin/DictionaryInfoUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/DictionaryInfoUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.content.ContentValues; import android.content.Context; @@ -23,6 +23,9 @@ import android.content.res.Resources; import android.text.format.DateUtils; import android.util.Log; +import com.android.inputmethod.latin.AssetFileAddress; +import com.android.inputmethod.latin.BinaryDictionaryGetter; +import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.makedict.BinaryDictIOUtils; import com.android.inputmethod.latin.makedict.FormatSpec.FileHeader; import com.android.inputmethod.latin.makedict.UnsupportedFormatException; @@ -38,9 +41,7 @@ import java.util.Locale; */ public class DictionaryInfoUtils { private static final String TAG = DictionaryInfoUtils.class.getSimpleName(); - // This class must be located in the same package as LatinIME.java. - private static final String RESOURCE_PACKAGE_NAME = - DictionaryInfoUtils.class.getPackage().getName(); + private static final String RESOURCE_PACKAGE_NAME = R.class.getPackage().getName(); private static final String DEFAULT_MAIN_DICT = "main"; private static final String MAIN_DICT_PREFIX = "main_"; // 6 digits - unicode is limited to 21 bits diff --git a/java/src/com/android/inputmethod/latin/FeedbackUtils.java b/java/src/com/android/inputmethod/latin/utils/FeedbackUtils.java similarity index 95% rename from java/src/com/android/inputmethod/latin/FeedbackUtils.java rename to java/src/com/android/inputmethod/latin/utils/FeedbackUtils.java index 0582763fe..ec7eaf4a0 100644 --- a/java/src/com/android/inputmethod/latin/FeedbackUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/FeedbackUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.content.Context; import android.content.Intent; diff --git a/java/src/com/android/inputmethod/latin/InputTypeUtils.java b/java/src/com/android/inputmethod/latin/utils/InputTypeUtils.java similarity index 99% rename from java/src/com/android/inputmethod/latin/InputTypeUtils.java rename to java/src/com/android/inputmethod/latin/utils/InputTypeUtils.java index 46194f6e4..19cd34011 100644 --- a/java/src/com/android/inputmethod/latin/InputTypeUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/InputTypeUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.text.InputType; import android.view.inputmethod.EditorInfo; diff --git a/java/src/com/android/inputmethod/latin/IntentUtils.java b/java/src/com/android/inputmethod/latin/utils/IntentUtils.java similarity index 97% rename from java/src/com/android/inputmethod/latin/IntentUtils.java rename to java/src/com/android/inputmethod/latin/utils/IntentUtils.java index d175af504..ea0168117 100644 --- a/java/src/com/android/inputmethod/latin/IntentUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/IntentUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.content.Intent; import android.text.TextUtils; diff --git a/java/src/com/android/inputmethod/latin/JniUtils.java b/java/src/com/android/inputmethod/latin/utils/JniUtils.java similarity index 96% rename from java/src/com/android/inputmethod/latin/JniUtils.java rename to java/src/com/android/inputmethod/latin/utils/JniUtils.java index 8aedee576..e7fdafaeb 100644 --- a/java/src/com/android/inputmethod/latin/JniUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/JniUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.util.Log; diff --git a/java/src/com/android/inputmethod/latin/LocaleUtils.java b/java/src/com/android/inputmethod/latin/utils/LocaleUtils.java similarity index 99% rename from java/src/com/android/inputmethod/latin/LocaleUtils.java rename to java/src/com/android/inputmethod/latin/utils/LocaleUtils.java index a1e40502e..58d062bbd 100644 --- a/java/src/com/android/inputmethod/latin/LocaleUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/LocaleUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.content.res.Configuration; import android.content.res.Resources; @@ -166,6 +166,7 @@ public final class LocaleUtils { static final Object sLockForRunInLocale = new Object(); + // TODO: Make this an external class public abstract static class RunInLocale { protected abstract T job(Resources res); diff --git a/java/src/com/android/inputmethod/dictionarypack/Utils.java b/java/src/com/android/inputmethod/latin/utils/LogUtils.java similarity index 76% rename from java/src/com/android/inputmethod/dictionarypack/Utils.java rename to java/src/com/android/inputmethod/latin/utils/LogUtils.java index c4a42dbbf..a0d2e0495 100644 --- a/java/src/com/android/inputmethod/dictionarypack/Utils.java +++ b/java/src/com/android/inputmethod/latin/utils/LogUtils.java @@ -14,16 +14,18 @@ * the License. */ -package com.android.inputmethod.dictionarypack; +package com.android.inputmethod.latin.utils; import android.util.Log; +import com.android.inputmethod.latin.LatinImeLogger; + /** - * A class for various utility methods, especially debugging. + * A class for logging and debugging utility methods. */ -public final class Utils { - private final static String TAG = Utils.class.getSimpleName() + ":DEBUG --"; - private final static boolean DEBUG = DictionaryProvider.DEBUG; +public final class LogUtils { + private final static String TAG = LogUtils.class.getSimpleName(); + private final static boolean sDBG = LatinImeLogger.sDBG; /** * Calls .toString() on its non-null argument or returns "null" @@ -39,13 +41,22 @@ public final class Utils { * @return a readable, carriage-return-separated string for the current stack trace. */ public static String getStackTrace() { + return getStackTrace(Integer.MAX_VALUE - 1); + } + + /** + * Get the string representation of the current stack trace, for debugging purposes. + * @param limit the maximum number of stack frames to be returned. + * @return a readable, carriage-return-separated string for the current stack trace. + */ + public static String getStackTrace(final int limit) { final StringBuilder sb = new StringBuilder(); try { throw new RuntimeException(); - } catch (RuntimeException e) { - StackTraceElement[] frames = e.getStackTrace(); + } catch (final RuntimeException e) { + final StackTraceElement[] frames = e.getStackTrace(); // Start at 1 because the first frame is here and we don't care about it - for (int j = 1; j < frames.length; ++j) { + for (int j = 1; j < frames.length && j < limit + 1; ++j) { sb.append(frames[j].toString() + "\n"); } } @@ -75,7 +86,7 @@ public final class Utils { * @param args the stuff to send to the log */ public static void l(final Object... args) { - if (!DEBUG) return; + if (!sDBG) return; final StringBuilder sb = new StringBuilder(); for (final Object o : args) { sb.append(s(o).toString()); @@ -92,7 +103,7 @@ public final class Utils { * @param args the stuff to send to the log */ public static void r(final Object... args) { - if (!DEBUG) return; + if (!sDBG) return; final StringBuilder sb = new StringBuilder("\u001B[31m"); for (final Object o : args) { sb.append(s(o).toString()); diff --git a/java/src/com/android/inputmethod/latin/MetadataFileUriGetter.java b/java/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java similarity index 92% rename from java/src/com/android/inputmethod/latin/MetadataFileUriGetter.java rename to java/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java index a98ecc7b6..9ad319da6 100644 --- a/java/src/com/android/inputmethod/latin/MetadataFileUriGetter.java +++ b/java/src/com/android/inputmethod/latin/utils/MetadataFileUriGetter.java @@ -14,7 +14,9 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; + +import com.android.inputmethod.latin.R; import android.content.Context; diff --git a/java/src/com/android/inputmethod/latin/PositionalInfoForUserDictPendingAddition.java b/java/src/com/android/inputmethod/latin/utils/PositionalInfoForUserDictPendingAddition.java similarity index 98% rename from java/src/com/android/inputmethod/latin/PositionalInfoForUserDictPendingAddition.java rename to java/src/com/android/inputmethod/latin/utils/PositionalInfoForUserDictPendingAddition.java index a8800007a..1fc7eccc6 100644 --- a/java/src/com/android/inputmethod/latin/PositionalInfoForUserDictPendingAddition.java +++ b/java/src/com/android/inputmethod/latin/utils/PositionalInfoForUserDictPendingAddition.java @@ -14,10 +14,12 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.view.inputmethod.EditorInfo; +import com.android.inputmethod.latin.RichInputConnection; + import java.util.Locale; /** diff --git a/java/src/com/android/inputmethod/latin/RecapitalizeStatus.java b/java/src/com/android/inputmethod/latin/utils/RecapitalizeStatus.java similarity index 98% rename from java/src/com/android/inputmethod/latin/RecapitalizeStatus.java rename to java/src/com/android/inputmethod/latin/utils/RecapitalizeStatus.java index b9d7dcf78..0f5cd80db 100644 --- a/java/src/com/android/inputmethod/latin/RecapitalizeStatus.java +++ b/java/src/com/android/inputmethod/latin/utils/RecapitalizeStatus.java @@ -14,9 +14,7 @@ * the License. */ -package com.android.inputmethod.latin; - -import com.android.inputmethod.latin.StringUtils; +package com.android.inputmethod.latin.utils; import java.util.Locale; diff --git a/java/src/com/android/inputmethod/latin/ResizableIntArray.java b/java/src/com/android/inputmethod/latin/utils/ResizableIntArray.java similarity index 99% rename from java/src/com/android/inputmethod/latin/ResizableIntArray.java rename to java/src/com/android/inputmethod/latin/utils/ResizableIntArray.java index 691f0602a..4c7739a7a 100644 --- a/java/src/com/android/inputmethod/latin/ResizableIntArray.java +++ b/java/src/com/android/inputmethod/latin/utils/ResizableIntArray.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import java.util.Arrays; diff --git a/java/src/com/android/inputmethod/latin/ResourceUtils.java b/java/src/com/android/inputmethod/latin/utils/ResourceUtils.java similarity index 99% rename from java/src/com/android/inputmethod/latin/ResourceUtils.java rename to java/src/com/android/inputmethod/latin/utils/ResourceUtils.java index 0eb8b4f09..ffec57548 100644 --- a/java/src/com/android/inputmethod/latin/ResourceUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/ResourceUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.content.res.Resources; import android.content.res.TypedArray; diff --git a/java/src/com/android/inputmethod/latin/StaticInnerHandlerWrapper.java b/java/src/com/android/inputmethod/latin/utils/StaticInnerHandlerWrapper.java similarity index 96% rename from java/src/com/android/inputmethod/latin/StaticInnerHandlerWrapper.java rename to java/src/com/android/inputmethod/latin/utils/StaticInnerHandlerWrapper.java index e50af4d2d..44e5d17b4 100644 --- a/java/src/com/android/inputmethod/latin/StaticInnerHandlerWrapper.java +++ b/java/src/com/android/inputmethod/latin/utils/StaticInnerHandlerWrapper.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.os.Handler; import android.os.Looper; diff --git a/java/src/com/android/inputmethod/latin/StringUtils.java b/java/src/com/android/inputmethod/latin/utils/StringUtils.java similarity index 99% rename from java/src/com/android/inputmethod/latin/StringUtils.java rename to java/src/com/android/inputmethod/latin/utils/StringUtils.java index c2fd4fb32..7406d855a 100644 --- a/java/src/com/android/inputmethod/latin/StringUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/StringUtils.java @@ -14,10 +14,12 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.text.TextUtils; +import com.android.inputmethod.latin.Constants; + import java.util.ArrayList; import java.util.Locale; diff --git a/java/src/com/android/inputmethod/latin/TargetPackageInfoGetterTask.java b/java/src/com/android/inputmethod/latin/utils/TargetPackageInfoGetterTask.java similarity index 98% rename from java/src/com/android/inputmethod/latin/TargetPackageInfoGetterTask.java rename to java/src/com/android/inputmethod/latin/utils/TargetPackageInfoGetterTask.java index 947b0c586..afbe2ecad 100644 --- a/java/src/com/android/inputmethod/latin/TargetPackageInfoGetterTask.java +++ b/java/src/com/android/inputmethod/latin/utils/TargetPackageInfoGetterTask.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.content.Context; import android.content.pm.PackageInfo; diff --git a/java/src/com/android/inputmethod/latin/UserHistoryDictIOUtils.java b/java/src/com/android/inputmethod/latin/utils/UserHistoryDictIOUtils.java similarity index 98% rename from java/src/com/android/inputmethod/latin/UserHistoryDictIOUtils.java rename to java/src/com/android/inputmethod/latin/utils/UserHistoryDictIOUtils.java index 5233ed7d3..32eb0b2c5 100644 --- a/java/src/com/android/inputmethod/latin/UserHistoryDictIOUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/UserHistoryDictIOUtils.java @@ -14,11 +14,12 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.util.Log; import com.android.inputmethod.annotations.UsedForTesting; +import com.android.inputmethod.latin.UserHistoryDictionaryBigramList; import com.android.inputmethod.latin.makedict.BinaryDictIOUtils; import com.android.inputmethod.latin.makedict.BinaryDictInputOutput; import com.android.inputmethod.latin.makedict.BinaryDictInputOutput.FusionDictionaryBufferInterface; diff --git a/java/src/com/android/inputmethod/latin/UserHistoryForgettingCurveUtils.java b/java/src/com/android/inputmethod/latin/utils/UserHistoryForgettingCurveUtils.java similarity index 99% rename from java/src/com/android/inputmethod/latin/UserHistoryForgettingCurveUtils.java rename to java/src/com/android/inputmethod/latin/utils/UserHistoryForgettingCurveUtils.java index 9053d709b..9f842f976 100644 --- a/java/src/com/android/inputmethod/latin/UserHistoryForgettingCurveUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/UserHistoryForgettingCurveUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.text.format.DateUtils; import android.util.Log; diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/utils/Utils.java similarity index 95% rename from java/src/com/android/inputmethod/latin/Utils.java rename to java/src/com/android/inputmethod/latin/utils/Utils.java index 949720fda..390d306c8 100644 --- a/java/src/com/android/inputmethod/latin/Utils.java +++ b/java/src/com/android/inputmethod/latin/utils/Utils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.app.Activity; import android.content.ComponentName; @@ -35,7 +35,12 @@ import android.text.TextUtils; import android.util.Log; import com.android.inputmethod.annotations.UsedForTesting; +import com.android.inputmethod.latin.Constants; +import com.android.inputmethod.latin.LatinIME; +import com.android.inputmethod.latin.LatinImeLogger; +import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; +import com.android.inputmethod.latin.WordComposer; import java.io.BufferedReader; import java.io.File; @@ -50,6 +55,7 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; +// TODO: Come up with a more descriptive class name public final class Utils { private static final String TAG = Utils.class.getSimpleName(); @@ -71,15 +77,17 @@ public final class Utils { } } - /* package */ static final class RingCharBuffer { + // TODO: Make this an external class + public /* for test */ static final class RingCharBuffer { + public /* for test */ static final int BUFSIZE = 20; + public /* for test */ int mLength = 0; + private static RingCharBuffer sRingCharBuffer = new RingCharBuffer(); private static final char PLACEHOLDER_DELIMITER_CHAR = '\uFFFC'; private static final int INVALID_COORDINATE = -2; - /* package */ static final int BUFSIZE = 20; private InputMethodService mContext; private boolean mEnabled = false; private int mEnd = 0; - /* package */ int mLength = 0; private char[] mCharBuf = new char[BUFSIZE]; private int[] mXBuf = new int[BUFSIZE]; private int[] mYBuf = new int[BUFSIZE]; @@ -184,25 +192,7 @@ public final class Utils { } } - // Get the current stack trace - public static String getStackTrace(final int limit) { - final StringBuilder sb = new StringBuilder(); - try { - throw new RuntimeException(); - } catch (final RuntimeException e) { - final StackTraceElement[] frames = e.getStackTrace(); - // Start at 1 because the first frame is here and we don't care about it - for (int j = 1; j < frames.length && j < limit + 1; ++j) { - sb.append(frames[j].toString() + "\n"); - } - } - return sb.toString(); - } - - public static String getStackTrace() { - return getStackTrace(Integer.MAX_VALUE - 1); - } - + // TODO: Make this an external class public static final class UsabilityStudyLogUtils { // TODO: remove code duplication with ResearchLog class private static final String USABILITY_TAG = UsabilityStudyLogUtils.class.getSimpleName(); @@ -416,6 +406,7 @@ public final class Utils { } } + // TODO: Make this an external class public static final class Stats { public static void onNonSeparator(final char code, final int x, final int y) { RingCharBuffer.getInstance().push(code, x, y); @@ -495,6 +486,10 @@ public final class Utils { return 0; } + /** + * A utility method to get the application's PackageInfo.versionName + * @return the application's PackageInfo.versionName + */ public static String getVersionName(final Context context) { try { if (context == null) { diff --git a/java/src/com/android/inputmethod/latin/XmlParseUtils.java b/java/src/com/android/inputmethod/latin/utils/XmlParseUtils.java similarity index 98% rename from java/src/com/android/inputmethod/latin/XmlParseUtils.java rename to java/src/com/android/inputmethod/latin/utils/XmlParseUtils.java index 48e5ed30a..bdad16652 100644 --- a/java/src/com/android/inputmethod/latin/XmlParseUtils.java +++ b/java/src/com/android/inputmethod/latin/utils/XmlParseUtils.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.content.res.TypedArray; diff --git a/java/src/com/android/inputmethod/research/ResearchLogger.java b/java/src/com/android/inputmethod/research/ResearchLogger.java index 6029ba963..3abeb76a0 100644 --- a/java/src/com/android/inputmethod/research/ResearchLogger.java +++ b/java/src/com/android/inputmethod/research/ResearchLogger.java @@ -61,7 +61,6 @@ import com.android.inputmethod.keyboard.KeyboardView; import com.android.inputmethod.keyboard.MainKeyboardView; import com.android.inputmethod.latin.Constants; import com.android.inputmethod.latin.Dictionary; -import com.android.inputmethod.latin.InputTypeUtils; import com.android.inputmethod.latin.LatinIME; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.RichInputConnection; @@ -69,6 +68,7 @@ import com.android.inputmethod.latin.RichInputConnection.Range; import com.android.inputmethod.latin.Suggest; import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.define.ProductionFlag; +import com.android.inputmethod.latin.utils.InputTypeUtils; import com.android.inputmethod.research.MotionEventReader.ReplayData; import java.io.File; diff --git a/tests/src/com/android/inputmethod/keyboard/SpacebarTextTests.java b/tests/src/com/android/inputmethod/keyboard/SpacebarTextTests.java index 850af94f7..057a0c0bf 100644 --- a/tests/src/com/android/inputmethod/keyboard/SpacebarTextTests.java +++ b/tests/src/com/android/inputmethod/keyboard/SpacebarTextTests.java @@ -23,11 +23,11 @@ import android.test.suitebuilder.annotation.SmallTest; import android.view.inputmethod.InputMethodSubtype; import com.android.inputmethod.latin.AdditionalSubtype; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.RichInputMethodManager; -import com.android.inputmethod.latin.StringUtils; import com.android.inputmethod.latin.SubtypeLocale; -import com.android.inputmethod.latin.LocaleUtils.RunInLocale; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.LocaleUtils.RunInLocale; +import com.android.inputmethod.latin.utils.StringUtils; import java.util.ArrayList; import java.util.Locale; diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserSplitTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserSplitTests.java index eea1efc49..f04c7e953 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserSplitTests.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserSplitTests.java @@ -22,8 +22,8 @@ import android.content.res.Resources; import android.test.InstrumentationTestCase; import android.test.suitebuilder.annotation.MediumTest; -import com.android.inputmethod.latin.CollectionUtils; -import com.android.inputmethod.latin.LocaleUtils.RunInLocale; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.LocaleUtils.RunInLocale; import java.lang.reflect.Field; import java.util.ArrayList; diff --git a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java index b55158d3e..2d9dc5e3b 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/KeySpecParserTests.java @@ -26,7 +26,7 @@ import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; import com.android.inputmethod.latin.Constants; -import com.android.inputmethod.latin.LocaleUtils.RunInLocale; +import com.android.inputmethod.latin.utils.LocaleUtils.RunInLocale; import java.util.Arrays; import java.util.Locale; diff --git a/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java b/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java index 8506e16f2..db3997651 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java @@ -19,7 +19,7 @@ package com.android.inputmethod.keyboard.internal; import android.text.TextUtils; import com.android.inputmethod.latin.Constants; -import com.android.inputmethod.latin.RecapitalizeStatus; +import com.android.inputmethod.latin.utils.RecapitalizeStatus; public class MockKeyboardSwitcher implements KeyboardState.SwitchActions { public interface MockConstants { diff --git a/tests/src/com/android/inputmethod/latin/InputPointersTests.java b/tests/src/com/android/inputmethod/latin/InputPointersTests.java index 301582979..f0b6acc75 100644 --- a/tests/src/com/android/inputmethod/latin/InputPointersTests.java +++ b/tests/src/com/android/inputmethod/latin/InputPointersTests.java @@ -19,6 +19,8 @@ package com.android.inputmethod.latin; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; +import com.android.inputmethod.latin.utils.ResizableIntArray; + import java.util.Arrays; @SmallTest diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java index aec4aaca1..c765ce5ee 100644 --- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java @@ -36,6 +36,7 @@ import android.widget.FrameLayout; import com.android.inputmethod.keyboard.Key; import com.android.inputmethod.keyboard.Keyboard; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; +import com.android.inputmethod.latin.utils.LocaleUtils; import java.util.Locale; diff --git a/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java b/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java index abfaf3062..b64013e04 100644 --- a/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java +++ b/tests/src/com/android/inputmethod/latin/SubtypeLocaleTests.java @@ -22,7 +22,8 @@ import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; import android.view.inputmethod.InputMethodSubtype; -import com.android.inputmethod.latin.LocaleUtils.RunInLocale; +import com.android.inputmethod.latin.utils.CollectionUtils; +import com.android.inputmethod.latin.utils.LocaleUtils.RunInLocale; import java.util.ArrayList; import java.util.Locale; diff --git a/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java b/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java index 916252292..8d0fe014c 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java +++ b/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java @@ -21,6 +21,8 @@ import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; +import com.android.inputmethod.latin.utils.CollectionUtils; + import java.util.ArrayList; import java.util.Locale; diff --git a/tests/src/com/android/inputmethod/latin/UserHistoryDictionaryTests.java b/tests/src/com/android/inputmethod/latin/UserHistoryDictionaryTests.java index 594ba0e7b..93befd7bf 100644 --- a/tests/src/com/android/inputmethod/latin/UserHistoryDictionaryTests.java +++ b/tests/src/com/android/inputmethod/latin/UserHistoryDictionaryTests.java @@ -22,6 +22,8 @@ import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.LargeTest; import android.util.Log; +import com.android.inputmethod.latin.utils.CollectionUtils; + import java.io.File; import java.util.ArrayList; import java.util.List; diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java index 7890782bf..cca81a0e0 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOTests.java @@ -23,12 +23,12 @@ import android.util.Log; import android.util.SparseArray; import com.android.inputmethod.latin.ByteArrayWrapper; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.makedict.BinaryDictInputOutput.FusionDictionaryBufferInterface; import com.android.inputmethod.latin.makedict.FormatSpec.FileHeader; import com.android.inputmethod.latin.makedict.FusionDictionary.CharGroup; import com.android.inputmethod.latin.makedict.FusionDictionary.Node; import com.android.inputmethod.latin.makedict.FusionDictionary.WeightedString; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.io.File; import java.io.FileInputStream; diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtilsTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtilsTests.java index 08ae89b29..d33142ce0 100644 --- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtilsTests.java +++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictIOUtilsTests.java @@ -21,12 +21,12 @@ import android.test.MoreAsserts; import android.test.suitebuilder.annotation.LargeTest; import android.util.Log; -import com.android.inputmethod.latin.CollectionUtils; import com.android.inputmethod.latin.makedict.BinaryDictInputOutput.ByteBufferWrapper; import com.android.inputmethod.latin.makedict.BinaryDictInputOutput.FusionDictionaryBufferInterface; import com.android.inputmethod.latin.makedict.FormatSpec.FileHeader; import com.android.inputmethod.latin.makedict.FusionDictionary.Node; import com.android.inputmethod.latin.makedict.FusionDictionary.WeightedString; +import com.android.inputmethod.latin.utils.CollectionUtils; import java.io.BufferedOutputStream; import java.io.File; diff --git a/tests/src/com/android/inputmethod/latin/CapsModeUtilsTests.java b/tests/src/com/android/inputmethod/latin/utils/CapsModeUtilsTests.java similarity index 98% rename from tests/src/com/android/inputmethod/latin/CapsModeUtilsTests.java rename to tests/src/com/android/inputmethod/latin/utils/CapsModeUtilsTests.java index 339791d57..cf3bdd680 100644 --- a/tests/src/com/android/inputmethod/latin/CapsModeUtilsTests.java +++ b/tests/src/com/android/inputmethod/latin/utils/CapsModeUtilsTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; diff --git a/tests/src/com/android/inputmethod/latin/ForgettingCurveTests.java b/tests/src/com/android/inputmethod/latin/utils/ForgettingCurveTests.java similarity index 98% rename from tests/src/com/android/inputmethod/latin/ForgettingCurveTests.java rename to tests/src/com/android/inputmethod/latin/utils/ForgettingCurveTests.java index 3259312df..823bd5d7d 100644 --- a/tests/src/com/android/inputmethod/latin/ForgettingCurveTests.java +++ b/tests/src/com/android/inputmethod/latin/utils/ForgettingCurveTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; diff --git a/tests/src/com/android/inputmethod/latin/RecapitalizeStatusTests.java b/tests/src/com/android/inputmethod/latin/utils/RecapitalizeStatusTests.java similarity index 99% rename from tests/src/com/android/inputmethod/latin/RecapitalizeStatusTests.java rename to tests/src/com/android/inputmethod/latin/utils/RecapitalizeStatusTests.java index 9d7203e5a..a52041264 100644 --- a/tests/src/com/android/inputmethod/latin/RecapitalizeStatusTests.java +++ b/tests/src/com/android/inputmethod/latin/utils/RecapitalizeStatusTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; diff --git a/tests/src/com/android/inputmethod/latin/ResizableIntArrayTests.java b/tests/src/com/android/inputmethod/latin/utils/ResizableIntArrayTests.java similarity index 99% rename from tests/src/com/android/inputmethod/latin/ResizableIntArrayTests.java rename to tests/src/com/android/inputmethod/latin/utils/ResizableIntArrayTests.java index b9fee950e..cfff61ef8 100644 --- a/tests/src/com/android/inputmethod/latin/ResizableIntArrayTests.java +++ b/tests/src/com/android/inputmethod/latin/utils/ResizableIntArrayTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; diff --git a/tests/src/com/android/inputmethod/latin/ResourceUtilsTests.java b/tests/src/com/android/inputmethod/latin/utils/ResourceUtilsTests.java similarity index 98% rename from tests/src/com/android/inputmethod/latin/ResourceUtilsTests.java rename to tests/src/com/android/inputmethod/latin/utils/ResourceUtilsTests.java index c915522ee..1ae22e307 100644 --- a/tests/src/com/android/inputmethod/latin/ResourceUtilsTests.java +++ b/tests/src/com/android/inputmethod/latin/utils/ResourceUtilsTests.java @@ -14,12 +14,12 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; -import com.android.inputmethod.latin.ResourceUtils.DeviceOverridePatternSyntaxError; +import com.android.inputmethod.latin.utils.ResourceUtils.DeviceOverridePatternSyntaxError; import java.util.HashMap; diff --git a/tests/src/com/android/inputmethod/latin/StringUtilsTests.java b/tests/src/com/android/inputmethod/latin/utils/StringUtilsTests.java similarity index 99% rename from tests/src/com/android/inputmethod/latin/StringUtilsTests.java rename to tests/src/com/android/inputmethod/latin/utils/StringUtilsTests.java index 4f260987b..9ee8e387b 100644 --- a/tests/src/com/android/inputmethod/latin/StringUtilsTests.java +++ b/tests/src/com/android/inputmethod/latin/utils/StringUtilsTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; diff --git a/tests/src/com/android/inputmethod/latin/UserHistoryDictIOUtilsTests.java b/tests/src/com/android/inputmethod/latin/utils/UserHistoryDictIOUtilsTests.java similarity index 95% rename from tests/src/com/android/inputmethod/latin/UserHistoryDictIOUtilsTests.java rename to tests/src/com/android/inputmethod/latin/utils/UserHistoryDictIOUtilsTests.java index 6778e6650..0d829c5e6 100644 --- a/tests/src/com/android/inputmethod/latin/UserHistoryDictIOUtilsTests.java +++ b/tests/src/com/android/inputmethod/latin/utils/UserHistoryDictIOUtilsTests.java @@ -14,18 +14,20 @@ * limitations under the License. */ -package com.android.inputmethod.latin; +package com.android.inputmethod.latin.utils; import android.content.Context; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.LargeTest; import android.util.Log; -import com.android.inputmethod.latin.UserHistoryDictIOUtils.BigramDictionaryInterface; -import com.android.inputmethod.latin.UserHistoryDictIOUtils.OnAddWordListener; +import com.android.inputmethod.latin.ByteArrayWrapper; +import com.android.inputmethod.latin.UserHistoryDictionaryBigramList; import com.android.inputmethod.latin.makedict.FormatSpec; import com.android.inputmethod.latin.makedict.FusionDictionary; import com.android.inputmethod.latin.makedict.FusionDictionary.CharGroup; +import com.android.inputmethod.latin.utils.UserHistoryDictIOUtils.BigramDictionaryInterface; +import com.android.inputmethod.latin.utils.UserHistoryDictIOUtils.OnAddWordListener; import java.io.File; import java.io.FileInputStream; @@ -152,8 +154,7 @@ public class UserHistoryDictIOUtilsTests extends AndroidTestCase final byte[] buffer = new byte[(int)file.length()]; inStream.read(buffer); - UserHistoryDictIOUtils.readDictionaryBinary( - new ByteArrayWrapper(buffer), listener); + UserHistoryDictIOUtils.readDictionaryBinary(new ByteArrayWrapper(buffer), listener); } catch (FileNotFoundException e) { Log.e(TAG, "file not found", e); } catch (IOException e) { diff --git a/tools/dicttool/Android.mk b/tools/dicttool/Android.mk index c99ba2f99..931678793 100644 --- a/tools/dicttool/Android.mk +++ b/tools/dicttool/Android.mk @@ -30,8 +30,8 @@ DICTTOOL_ONDEVICE_TESTS_DIRECTORY := \ USED_TARGETTED_UTILS := \ $(FRAMEWORK_TOP)/android/util/SparseArray.java \ $(FRAMEWORK_TOP)/com/android/internal/util/ArrayUtils.java \ - $(LATINIME_CORE_SOURCE_DIRECTORY)/CollectionUtils.java \ - $(LATINIME_CORE_SOURCE_DIRECTORY)/ByteArrayWrapper.java + $(LATINIME_CORE_SOURCE_DIRECTORY)/ByteArrayWrapper.java \ + $(LATINIME_CORE_SOURCE_DIRECTORY)/utils/CollectionUtils.java LOCAL_MAIN_SRC_FILES := $(call all-java-files-under, $(MAKEDICT_CORE_SOURCE_DIRECTORY)) LOCAL_TOOL_SRC_FILES := $(call all-java-files-under, src)