diff options
Diffstat (limited to 'tools/dicttool/compat/android')
4 files changed, 30 insertions, 6 deletions
diff --git a/tools/dicttool/compat/android/content/Context.java b/tools/dicttool/compat/android/content/Context.java new file mode 100644 index 000000000..afe1322ac --- /dev/null +++ b/tools/dicttool/compat/android/content/Context.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.content; + +public class Context { +} diff --git a/tools/dicttool/compat/android/test/AndroidTestCase.java b/tools/dicttool/compat/android/test/AndroidTestCase.java index d01b7ad7c..f765ce0fc 100644 --- a/tools/dicttool/compat/android/test/AndroidTestCase.java +++ b/tools/dicttool/compat/android/test/AndroidTestCase.java @@ -16,6 +16,8 @@ package android.test; +import com.android.inputmethod.latin.dicttool.Test; + import junit.framework.TestCase; import java.io.File; @@ -27,7 +29,11 @@ import java.io.File; */ public class AndroidTestCase extends TestCase { public File getCacheDir() { - return new File("."); + final File dir = Test.TEST_TMP_DIR; + if (!dir.isDirectory()) { + dir.mkdirs(); + } + return dir; } public AndroidTestCase getContext() { return this; diff --git a/tools/dicttool/compat/android/util/SparseArray.java b/tools/dicttool/compat/android/util/SparseArray.java index 6c76f19f4..9efbd39c7 100644 --- a/tools/dicttool/compat/android/util/SparseArray.java +++ b/tools/dicttool/compat/android/util/SparseArray.java @@ -16,8 +16,6 @@ package android.util; -import com.android.inputmethod.latin.utils.CollectionUtils; - import java.util.ArrayList; import java.util.Collections; @@ -30,8 +28,8 @@ public class SparseArray<E> { } public SparseArray(final int initialCapacity) { - mKeys = CollectionUtils.newArrayList(initialCapacity); - mValues = CollectionUtils.newArrayList(initialCapacity); + mKeys = new ArrayList<>(initialCapacity); + mValues = new ArrayList<>(initialCapacity); } public int size() { diff --git a/tools/dicttool/compat/android/util/SparseIntArray.java b/tools/dicttool/compat/android/util/SparseIntArray.java index ac8a04ceb..e4d3dfd07 100644 --- a/tools/dicttool/compat/android/util/SparseIntArray.java +++ b/tools/dicttool/compat/android/util/SparseIntArray.java @@ -24,7 +24,7 @@ public class SparseIntArray { } public SparseIntArray(final int initialCapacity) { - mArray = new SparseArray<Integer>(initialCapacity); + mArray = new SparseArray<>(initialCapacity); } public int size() { |