aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorPo Lu2024-07-16 10:14:30 +0800
committerPo Lu2024-07-18 13:34:55 +0800
commit34882d524328638e2198952578638e0ffe0697c5 (patch)
treeb4c2d713860d740ff5712423e1684d924d59eacd /java
parent765cfaed775567afde3607b87f2657f0c0179f28 (diff)
downloademacs-34882d524328638e2198952578638e0ffe0697c5.tar.gz
emacs-34882d524328638e2198952578638e0ffe0697c5.zip
Port better to Android 3.0
* java/org/gnu/emacs/EmacsNoninteractive.java (main): Use the old getPackageInfo calling convention if it exists rather than on Android 2.3.3 and earlier.
Diffstat (limited to 'java')
-rw-r--r--java/org/gnu/emacs/EmacsNoninteractive.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/java/org/gnu/emacs/EmacsNoninteractive.java b/java/org/gnu/emacs/EmacsNoninteractive.java
index 9f2b9fa8b56..8a1ad98d8f9 100644
--- a/java/org/gnu/emacs/EmacsNoninteractive.java
+++ b/java/org/gnu/emacs/EmacsNoninteractive.java
@@ -120,11 +120,11 @@ public final class EmacsNoninteractive
120 } 120 }
121 121
122 /* Get a LoadedApk or ActivityThread.PackageInfo. How to do 122 /* Get a LoadedApk or ActivityThread.PackageInfo. How to do
123 this varies by Android version. On Android 2.3.3 and 123 this varies by Android version. On Android 3.0 and earlier,
124 earlier, there is no ``compatibilityInfo'' argument to 124 there is no ``compatibilityInfo'' argument to
125 getPackageInfo. */ 125 getPackageInfo. */
126 126
127 if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) 127 try
128 { 128 {
129 method 129 method
130 = activityThreadClass.getMethod ("getPackageInfo", 130 = activityThreadClass.getMethod ("getPackageInfo",
@@ -134,7 +134,7 @@ public final class EmacsNoninteractive
134 (Context.CONTEXT_INCLUDE_CODE 134 (Context.CONTEXT_INCLUDE_CODE
135 | Context.CONTEXT_IGNORE_SECURITY)); 135 | Context.CONTEXT_IGNORE_SECURITY));
136 } 136 }
137 else 137 catch (NoSuchMethodException exception)
138 { 138 {
139 compatibilityInfoClass 139 compatibilityInfoClass
140 = Class.forName ("android.content.res.CompatibilityInfo"); 140 = Class.forName ("android.content.res.CompatibilityInfo");