summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoey Hewitt <joey@joeyhewitt.com>2017-10-06 16:36:09 -0700
committerJoey Hewitt <joey@joeyhewitt.com>2017-10-06 16:36:09 -0700
commitb6e0aefb35cd9c8aff9654ab9d4cbc15298c8706 (patch)
treed662e769a8c6f336c56ba43535370df4c88aec44
parent4109a811aa8624aeb568b06e86cab3853169be83 (diff)
downloadframeworks_opt_telephony_ril_ofono-b6e0aefb35cd9c8aff9654ab9d4cbc15298c8706.tar.gz
frameworks_opt_telephony_ril_ofono-b6e0aefb35cd9c8aff9654ab9d4cbc15298c8706.tar.bz2
frameworks_opt_telephony_ril_ofono-b6e0aefb35cd9c8aff9654ab9d4cbc15298c8706.zip
extract auxiliary classes and fix rawtypes
-rw-r--r--build/java/net/scintill/ril_ofono/BuildRilWrapper.java4
-rw-r--r--src/java/net/scintill/ril_ofono/DebouncedRunnable.java23
-rw-r--r--src/java/net/scintill/ril_ofono/OkOnMainThread.java32
-rw-r--r--src/java/net/scintill/ril_ofono/RilOfono.java14
4 files changed, 57 insertions, 16 deletions
diff --git a/build/java/net/scintill/ril_ofono/BuildRilWrapper.java b/build/java/net/scintill/ril_ofono/BuildRilWrapper.java
index 631099a..2220ad0 100644
--- a/build/java/net/scintill/ril_ofono/BuildRilWrapper.java
+++ b/build/java/net/scintill/ril_ofono/BuildRilWrapper.java
@@ -76,7 +76,7 @@ import java.util.List;
os.println(getMethodSignature(commandsIfaceMethod) + " {");
String messageParamName = "msg";
- Class[] paramTypes = commandsIfaceMethod.getParameterTypes();
+ Class<?>[] paramTypes = commandsIfaceMethod.getParameterTypes();
//os.printf("Rlog.v(TAG, \"%s \" + (%s != null ? %s.what : null) + \" \" + (%s != null ? %s.getTarget() : \"\"));%n", commandsIfaceMethod.getName(), messageParamName, messageParamName, messageParamName, messageParamName);
boolean isAsync = paramTypesExcludingMessage.length != paramTypes.length;
boolean isOkOnMainThread = moduleMethod.isAnnotationPresent(OkOnMainThread.class);
@@ -175,7 +175,7 @@ import java.util.List;
RilOfono.class,
};
- private static Class<?> findModuleClass(Method commandsIfaceMethod, Class[] paramTypesExcludingMessage) {
+ private static Class<?> findModuleClass(Method commandsIfaceMethod, Class<?>[] paramTypesExcludingMessage) {
for (Class<?> moduleClass : moduleClasses) {
try {
moduleClass.getMethod(commandsIfaceMethod.getName(), paramTypesExcludingMessage);
diff --git a/src/java/net/scintill/ril_ofono/DebouncedRunnable.java b/src/java/net/scintill/ril_ofono/DebouncedRunnable.java
new file mode 100644
index 0000000..273c6a4
--- /dev/null
+++ b/src/java/net/scintill/ril_ofono/DebouncedRunnable.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2017 Joey Hewitt <joey@joeyhewitt.com>
+ *
+ * This file is part of ril_ofono.
+ *
+ * ril_ofono is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * ril_ofono is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ril_ofono. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.scintill.ril_ofono;
+
+// mostly a tag type to remind me use this correctly (only construct one for each purpose)
+/*package*/ abstract class DebouncedRunnable implements Runnable {}
diff --git a/src/java/net/scintill/ril_ofono/OkOnMainThread.java b/src/java/net/scintill/ril_ofono/OkOnMainThread.java
new file mode 100644
index 0000000..ae7b085
--- /dev/null
+++ b/src/java/net/scintill/ril_ofono/OkOnMainThread.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2017 Joey Hewitt <joey@joeyhewitt.com>
+ *
+ * This file is part of ril_ofono.
+ *
+ * ril_ofono is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * ril_ofono is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ril_ofono. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.scintill.ril_ofono;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+// does not need to be available at true runtime, just when BuildRilWrapper runs, but
+// I'm not sure that can be done without spelunking into classfiles
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+/*package*/ @interface OkOnMainThread {
+}
diff --git a/src/java/net/scintill/ril_ofono/RilOfono.java b/src/java/net/scintill/ril_ofono/RilOfono.java
index e29b5b9..6c902cd 100644
--- a/src/java/net/scintill/ril_ofono/RilOfono.java
+++ b/src/java/net/scintill/ril_ofono/RilOfono.java
@@ -60,10 +60,6 @@ import org.ofono.SupplementaryServices;
import org.ofono.VoiceCall;
import org.ofono.VoiceCallManager;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
@@ -1235,13 +1231,3 @@ import static com.android.internal.telephony.CommandsInterface.RadioState;
}
}
}
-
-// mostly a tag type to remind me use this correctly (only construct one for each purpose)
-/*package*/ abstract class DebouncedRunnable implements Runnable {}
-
-// does not need to be available at true runtime, just when BuildRilWrapper runs, but
-// I'm not sure that can be done without spelunking into classfiles
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.METHOD})
-/*package*/ @interface OkOnMainThread {
-}