aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorAmin Bandali <bandali@kelar.org>2024-12-10 11:54:39 -0500
committerAmin Bandali <bandali@kelar.org>2025-01-11 14:15:56 -0500
commitfb3b9360d70596d7e921de8bf7d3ca99564a077e (patch)
tree07ded064b8374f44c6d7b88ea1c39bce09a6cdf3 /java
parent41fd35c1412b6b3b52acdd30027c6d7ac54cd17f (diff)
downloadlatinime-fb3b9360d70596d7e921de8bf7d3ca99564a077e.tar.gz
latinime-fb3b9360d70596d7e921de8bf7d3ca99564a077e.tar.xz
latinime-fb3b9360d70596d7e921de8bf7d3ca99564a077e.zip
Initial successful standalone build
Diffstat (limited to 'java')
-rw-r--r--java/Android.mk50
-rw-r--r--java/AndroidManifest_SdkVersion.xml20
-rw-r--r--java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityNodeProvider.java2
-rw-r--r--java/src/com/android/inputmethod/latin/utils/ResourceUtils.java3
4 files changed, 73 insertions, 2 deletions
diff --git a/java/Android.mk b/java/Android.mk
new file mode 100644
index 000000000..875aad4f9
--- /dev/null
+++ b/java/Android.mk
@@ -0,0 +1,50 @@
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := LatinIME
+
+LOCAL_CERTIFICATE := shared
+
+LOCAL_FULL_LIBS_MANIFEST_FILES := \
+ $(LOCAL_PATH)/AndroidManifest.xml \
+ $(LOCAL_PATH)/AndroidManifest_SdkVersion.xml
+
+LOCAL_JNI_SHARED_LIBRARIES := libjni_latinime
+
+LOCAL_STATIC_JAVA_LIBRARIES := \
+ android-common jsr305 latinime-common
+
+LOCAL_STATIC_ANDROID_LIBRARIES := \
+ androidx.legacy_legacy-support-v4
+
+LOCAL_USE_AAPT2 := true
+
+# Do not compress dictionary files to mmap dict data runtime
+LOCAL_AAPT_FLAGS := -0 .dict
+
+# Include all the resources regardless of system supported locales
+LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true
+
+LOCAL_SDK_VERSION := current
+
+LOCAL_PROGUARD_FLAG_FILES := proguard.flags
+
+include $(BUILD_PACKAGE)
diff --git a/java/AndroidManifest_SdkVersion.xml b/java/AndroidManifest_SdkVersion.xml
new file mode 100644
index 000000000..a843e83bb
--- /dev/null
+++ b/java/AndroidManifest_SdkVersion.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 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.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.inputmethod.latin">
+ <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
+</manifest>
diff --git a/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityNodeProvider.java b/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityNodeProvider.java
index 7266aa88a..cc244c305 100644
--- a/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityNodeProvider.java
+++ b/java/src/com/android/inputmethod/accessibility/KeyboardAccessibilityNodeProvider.java
@@ -236,7 +236,7 @@ final class KeyboardAccessibilityNodeProvider<KV extends KeyboardView>
// Obtain and initialize an AccessibilityNodeInfo with information about the virtual view.
final AccessibilityNodeInfoCompat info = AccessibilityNodeInfoCompat.obtain();
info.setPackageName(mKeyboardView.getContext().getPackageName());
- info.setTextEntryKey(true);
+ // info.setTextEntryKey(true);
info.setClassName(key.getClass().getName());
info.setContentDescription(keyDescription);
info.setBoundsInParent(boundsInParent);
diff --git a/java/src/com/android/inputmethod/latin/utils/ResourceUtils.java b/java/src/com/android/inputmethod/latin/utils/ResourceUtils.java
index f799be750..37b34751a 100644
--- a/java/src/com/android/inputmethod/latin/utils/ResourceUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/ResourceUtils.java
@@ -25,6 +25,7 @@ import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
+import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.WindowMetrics;
@@ -188,7 +189,7 @@ public final class ResourceUtils {
}
public static int getDefaultKeyboardWidth(final Context context) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
// Since Android 15’s edge-to-edge enforcement, window insets should be considered.
final WindowManager wm = context.getSystemService(WindowManager.class);
final WindowMetrics windowMetrics = wm.getCurrentWindowMetrics();