summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoey Hewitt <joey@joeyhewitt.com>2017-09-01 19:57:53 -0700
committerJoey Hewitt <joey@joeyhewitt.com>2017-09-02 01:51:40 -0700
commit4131ea26c56d8da18322904b07cb72cea0b2bd8a (patch)
tree0331b477070b2308ca2b556c6e70f1dbdd0b1b2c
parente67ecb23324622550fb24c38ba8a68eaa191eee6 (diff)
downloadframeworks_opt_telephony_ril_ofono-4131ea26c56d8da18322904b07cb72cea0b2bd8a.tar.gz
frameworks_opt_telephony_ril_ofono-4131ea26c56d8da18322904b07cb72cea0b2bd8a.tar.bz2
frameworks_opt_telephony_ril_ofono-4131ea26c56d8da18322904b07cb72cea0b2bd8a.zip
refactor: wrapper class that handles the async parts
Should remove repetitive code, and chances for errors like doing stuff on the wrong thread, or an exception that crashes the phone process or never responds to the caller after the error occurrred. One downside is that now *everything* is shuttled to another thread, even the trivial ones that just return some props. This can be addressed later by something like a @SafeForMainThread annotation.
-rw-r--r--build/java/net/scintill/ril_ofono/build/BuildRilWrapper.java142
-rw-r--r--src/java/net/scintill/ril_ofono/CallModule.java222
-rw-r--r--src/java/net/scintill/ril_ofono/DataConnModule.java94
-rw-r--r--src/java/net/scintill/ril_ofono/ModemModule.java60
-rw-r--r--src/java/net/scintill/ril_ofono/RilInterface.java291
-rw-r--r--src/java/net/scintill/ril_ofono/RilOfono.java783
-rw-r--r--src/java/net/scintill/ril_ofono/RilWrapper.java2382
-rw-r--r--src/java/net/scintill/ril_ofono/SimFiles.java15
-rw-r--r--src/java/net/scintill/ril_ofono/SimModule.java18
-rw-r--r--src/java/net/scintill/ril_ofono/SmsModule.java30
-rw-r--r--src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java36
-rwxr-xr-xstart2
-rwxr-xr-xstop2
13 files changed, 3301 insertions, 776 deletions
diff --git a/build/java/net/scintill/ril_ofono/build/BuildRilWrapper.java b/build/java/net/scintill/ril_ofono/build/BuildRilWrapper.java
new file mode 100644
index 0000000..dec0ef9
--- /dev/null
+++ b/build/java/net/scintill/ril_ofono/build/BuildRilWrapper.java
@@ -0,0 +1,142 @@
+/*
+ * 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.build;
+
+import android.os.Message;
+
+import com.android.internal.telephony.CommandsInterface;
+
+import net.scintill.ril_ofono.RilOfono;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import libcore.reflect.Types;
+
+public class BuildRilWrapper {
+
+ public void buildToFile(String path) throws IOException, NoSuchMethodException {
+ File f = new File(path);
+ PrintStream os = new PrintStream(new FileOutputStream(f));
+ //PrintStream os = System.err;
+ for (Method m : CommandsInterface.class.getMethods()) {
+ //boolean needsImpl = Modifier.isAbstract(BaseCommands.class.getMethod(m.getName(), m.getParameterTypes()).getModifiers());
+ boolean needsWrappedImpl = true;
+ try {
+ RilOfono.class.getDeclaredMethod(m.getName(), getParameterTypesExcludingMessage(m));
+ } catch (NoSuchMethodException e) {
+ needsWrappedImpl = false;
+ }
+ if (needsWrappedImpl) {
+ os.println(getMethodSignature(m).replace("java.lang.String", "String")+" {");
+ String messageParamName = "msg";
+ Class[] paramTypes = m.getParameterTypes();
+ boolean isAsync = Arrays.asList(paramTypes).contains(Message.class);
+ if (isAsync) {
+ os.println("runOnDbusThread(new Runnable() {");
+ os.println("public void run() {");
+ os.println("sCurrentMsg = msg;");
+ os.println("try {");
+ os.print("Object ret = ");
+ } else {
+ os.println("try {");
+ os.println("sCurrentMsg = null;");
+ os.print("return ");
+ }
+ os.print("mRilImpl."+m.getName()+"(");
+ char paramName = 'a';
+ for (Class paramType : paramTypes) {
+ if (!Message.class.isAssignableFrom(paramType)) {
+ if (paramName != 'a') {
+ os.print(", ");
+ }
+ os.print(paramName);
+ }
+ paramName++;
+ }
+ os.println(");");
+ if (isAsync) {
+ os.println("respondOk(\""+m.getName()+"\", "+messageParamName+", ret);");
+ }
+ os.println("} catch (CommandException exc) {");
+ if (isAsync) {
+ os.println("respondExc(\"" + m.getName() + "\", " + messageParamName + ", exc, null);");
+ } else {
+ os.println("// XXX implement me!");
+ }
+ os.println("} catch (Throwable thr) {");
+ os.println("Rlog.e(TAG, \"Uncaught exception in "+m.getName()+"\", privExc(thr));");
+ if (isAsync) {
+ os.println("respondExc(\""+m.getName()+"\", "+messageParamName+", new CommandException(GENERIC_FAILURE), null);");
+ } else {
+ os.println("// XXX implement me!");
+ }
+ os.println("}");
+ if (isAsync) {
+ os.println("}});");
+ }
+ os.println("}");
+ }
+ }
+ }
+
+ private static String getMethodSignature(Method method) {
+ StringBuilder buf = new StringBuilder();
+ buf.append(Modifier.toString(method.getModifiers() & ~Modifier.ABSTRACT));
+ buf.append(' ');
+ buf.append(method.getReturnType().getName());
+ buf.append(' ');
+ buf.append(method.getName());
+ buf.append('(');
+ char paramName = 'a';
+ for (Class paramClass : method.getParameterTypes()) {
+ if (paramName != 'a') {
+ buf.append(", ");
+ }
+ buf.append("final ");
+ Types.appendTypeName(buf, paramClass);
+ buf.append(' ');
+ if (!Message.class.isAssignableFrom(paramClass)) {
+ buf.append(paramName);
+ paramName++;
+ } else {
+ buf.append("msg");
+ }
+ }
+ buf.append(')');
+ return buf.toString().replaceAll("java.lang.String", "String");
+ }
+
+ private Class[] getParameterTypesExcludingMessage(Method method) {
+ List<Class> list = new ArrayList<>();
+ for (Class paramClass : method.getParameterTypes()) {
+ if (!Message.class.isAssignableFrom(paramClass)) list.add(paramClass);
+ }
+ return list.toArray(new Class[list.size()]);
+ }
+
+}
diff --git a/src/java/net/scintill/ril_ofono/CallModule.java b/src/java/net/scintill/ril_ofono/CallModule.java
index 37aefe5..b1939ea 100644
--- a/src/java/net/scintill/ril_ofono/CallModule.java
+++ b/src/java/net/scintill/ril_ofono/CallModule.java
@@ -19,11 +19,11 @@
package net.scintill.ril_ofono;
-import android.os.Message;
import android.os.RegistrantList;
import android.telephony.PhoneNumberUtils;
import android.telephony.Rlog;
+import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.DriverCall;
import com.android.internal.telephony.PhoneConstants;
@@ -46,9 +46,6 @@ import static com.android.internal.telephony.CommandException.Error.MODE_NOT_SUP
import static com.android.internal.telephony.CommandException.Error.NO_SUCH_ELEMENT;
import static net.scintill.ril_ofono.RilOfono.privExc;
import static net.scintill.ril_ofono.RilOfono.privStr;
-import static net.scintill.ril_ofono.RilOfono.respondExc;
-import static net.scintill.ril_ofono.RilOfono.respondOk;
-import static net.scintill.ril_ofono.RilOfono.runOnDbusThread;
import static net.scintill.ril_ofono.RilOfono.runOnMainThread;
import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
@@ -70,40 +67,35 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
@RilMethod
- public void getCurrentCalls(Message result) {
- try {
- List<DriverCall> calls = new ArrayList<>(mCallsProps.size());
- //Rlog.d(TAG, "mCallsProps= "+privStr(mCallsProps));
- for (Map<String, Variant> callProps : mCallsProps.values()) {
- DriverCall call = new DriverCall();
- call.state = Utils.parseOfonoCallState(getProp(callProps, "State", ""));
- call.index = getProp(callProps, PROPNAME_CALL_INDEX, -1);
- if (call.state == null || call.index == -1) {
- Rlog.e(TAG, "Skipping unknown call: "+privStr(callProps));
- continue; // <--- skip unknown call
- }
-
- String lineId = getProp(callProps, "LineIdentification", "");
- if (lineId.length() == 0 || lineId.equals("withheld")) lineId = null;
- call.TOA = PhoneNumberUtils.toaFromString(lineId);
- call.isMpty = false;
- call.isMT = !getProp(callProps, PROPNAME_CALL_MOBORIG, false);
- call.als = 0; // SimulatedGsmCallState
- call.isVoice = true;
- call.isVoicePrivacy = false; // oFono doesn't tell us
- call.number = lineId;
- call.numberPresentation = PhoneConstants.PRESENTATION_UNKNOWN;
- call.name = getProp(callProps, "Name", "");
- call.namePresentation = PhoneConstants.PRESENTATION_UNKNOWN;
- // TODO check if + is shown in number
- calls.add(call);
+ public Object getCurrentCalls() {
+ List<DriverCall> calls = new ArrayList<>(mCallsProps.size());
+ //Rlog.d(TAG, "mCallsProps= "+privStr(mCallsProps));
+ for (Map<String, Variant> callProps : mCallsProps.values()) {
+ DriverCall call = new DriverCall();
+ call.state = Utils.parseOfonoCallState(getProp(callProps, "State", ""));
+ call.index = getProp(callProps, PROPNAME_CALL_INDEX, -1);
+ if (call.state == null || call.index == -1) {
+ Rlog.e(TAG, "Skipping unknown call: "+privStr(callProps));
+ continue; // <--- skip unknown call
}
- Collections.sort(calls); // not sure why, but original RIL does
- respondOk("getCurrentCalls", result, new PrivResponseOb(calls));
- } catch (Throwable t) {
- Rlog.e(TAG, "Error getting calls", privExc(t));
- respondExc("getCurrentCalls", result, GENERIC_FAILURE, null);
+
+ String lineId = getProp(callProps, "LineIdentification", "");
+ if (lineId.length() == 0 || lineId.equals("withheld")) lineId = null;
+ call.TOA = PhoneNumberUtils.toaFromString(lineId);
+ call.isMpty = false;
+ call.isMT = !getProp(callProps, PROPNAME_CALL_MOBORIG, false);
+ call.als = 0; // SimulatedGsmCallState
+ call.isVoice = true;
+ call.isVoicePrivacy = false; // oFono doesn't tell us
+ call.number = lineId;
+ call.numberPresentation = PhoneConstants.PRESENTATION_UNKNOWN;
+ call.name = getProp(callProps, "Name", "");
+ call.namePresentation = PhoneConstants.PRESENTATION_UNKNOWN;
+ // TODO check if + is shown in number
+ calls.add(call);
}
+ Collections.sort(calls); // not sure why, but original RIL does
+ return new PrivResponseOb(calls);
}
private final Map<String, Map<String, Variant>> mCallsProps = new HashMap<>();
@@ -152,7 +144,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
@RilMethod
- public void dial(final String address, int clirMode, final Message result) {
+ public Object dial(final String address, int clirMode) {
final String clirModeStr;
switch (clirMode) {
case CommandsInterface.CLIR_DEFAULT: clirModeStr = "default"; break;
@@ -162,124 +154,90 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
throw new IllegalArgumentException("unknown CLIR constant "+clirMode);
}
- runOnDbusThread(new Runnable() {
- @Override
- public void run() {
- try {
- Path dialedCallPath = mCallManager.Dial(address, clirModeStr);
- Map<String, Variant> dialedCallProps = new HashMap<>();
- dialedCallProps.put(PROPNAME_CALL_MOBORIG, new Variant<>(true));
- putOrMerge2dProps(mCallsProps, dialedCallPath.getPath(), dialedCallProps);
- Rlog.d(TAG, "dialed "+dialedCallPath.getPath());
- respondOk("dial", result, null);
- } catch (Throwable t) {
- Rlog.e(TAG, "Error dialing", privExc(t));
- respondExc("dial", result, GENERIC_FAILURE, null);
- }
- }
- });
+ Path dialedCallPath = mCallManager.Dial(address, clirModeStr);
+ Map<String, Variant> dialedCallProps = new HashMap<>();
+ dialedCallProps.put(PROPNAME_CALL_MOBORIG, new Variant<>(true));
+ putOrMerge2dProps(mCallsProps, dialedCallPath.getPath(), dialedCallProps);
+ Rlog.d(TAG, "dialed "+dialedCallPath.getPath());
+ return null;
}
@RilMethod
- public void dial(String address, int clirMode, UUSInfo uusInfo, Message result) {
+ public Object dial(String address, int clirMode, UUSInfo uusInfo) {
if (uusInfo != null) {
- respondExc("dial", result, MODE_NOT_SUPPORTED, null);
+ throw new CommandException(MODE_NOT_SUPPORTED);
} else {
- dial(address, clirMode, result);
+ return dial(address, clirMode);
}
}
@RilMethod
- public void hangupConnection(final int gsmIndex, final Message result) {
- runOnDbusThread(new Runnable() {
- @Override
- public void run() {
- try {
- String callPath = getDbusPathForCallIndex(gsmIndex);
- if (callPath == null) {
- respondExc("hangupConnection", result, NO_SUCH_ELEMENT, null);
- return;
- }
- VoiceCall call = RilOfono.sInstance.getOfonoInterface(VoiceCall.class, callPath);
- call.Hangup();
- respondOk("hangupConnection", result, null);
- } catch (Throwable t) {
- Rlog.e(TAG, "Error hanging up", privExc(t));
- respondExc("hangupConnection", result, GENERIC_FAILURE, null);
- }
- }
- });
+ public Object hangupConnection(final int gsmIndex) {
+ String callPath = getDbusPathForCallIndex(gsmIndex);
+ if (callPath == null) {
+ throw new CommandException(NO_SUCH_ELEMENT);
+ }
+ VoiceCall call = RilOfono.sInstance.getOfonoInterface(VoiceCall.class, callPath);
+ call.Hangup();
+ return null;
}
@RilMethod
- public void hangupWaitingOrBackground(final Message result) {
- runOnDbusThread(new Runnable() {
- @Override
- public void run() {
- boolean oneSucceeded = false, oneExcepted = false;
- for (Map.Entry<String, Map<String, Variant>> callPropsEntry : mCallsProps.entrySet()) {
- String callPath = callPropsEntry.getKey();
- Map<String, Variant> callProps = callPropsEntry.getValue();
- try {
- DriverCall.State callState = Utils.parseOfonoCallState(getProp(callProps, "State", ""));
- // TODO which states should be hungup? should we only hang up one?
- if (callState != null) {
- switch (callState) {
- case INCOMING:
- case HOLDING:
- case WAITING:
- VoiceCall call = RilOfono.sInstance.getOfonoInterface(VoiceCall.class, callPath);
- call.Hangup();
- oneSucceeded = true;
- break;
- default:
- // skip
- }
- }
- } catch (Throwable t) {
- oneExcepted = true;
- Rlog.e(TAG, "Error checking/hangingup call", privExc(t));
+ public Object hangupWaitingOrBackground() {
+ boolean oneSucceeded = false, oneExcepted = false;
+ for (Map.Entry<String, Map<String, Variant>> callPropsEntry : mCallsProps.entrySet()) {
+ String callPath = callPropsEntry.getKey();
+ Map<String, Variant> callProps = callPropsEntry.getValue();
+ try {
+ DriverCall.State callState = Utils.parseOfonoCallState(getProp(callProps, "State", ""));
+ // TODO which states should be hungup? should we only hang up one?
+ if (callState != null) {
+ switch (callState) {
+ case INCOMING:
+ case HOLDING:
+ case WAITING:
+ VoiceCall call = RilOfono.sInstance.getOfonoInterface(VoiceCall.class, callPath);
+ call.Hangup();
+ oneSucceeded = true;
+ break;
+ default:
+ // skip
}
}
-
- if (oneSucceeded) {
- respondOk("hangupWaitingOrBackground", result, null);
- } else if (oneExcepted) {
- respondExc("hangupWaitingOrBackground", result, GENERIC_FAILURE, null);
- } else {
- respondExc("hangupWaitingOrBackground", result, NO_SUCH_ELEMENT, null);
- }
+ } catch (Throwable t) {
+ oneExcepted = true;
+ Rlog.e(TAG, "Error checking/hangingup call", privExc(t));
}
- });
+ }
+
+ if (oneSucceeded) {
+ return null;
+ } else if (oneExcepted) {
+ throw new CommandException(GENERIC_FAILURE);
+ } else {
+ throw new CommandException(NO_SUCH_ELEMENT);
+ }
}
@RilMethod
- public void acceptCall(final Message result) {
- runOnDbusThread(new Runnable() {
- @Override
- public void run() {
- try {
- for (Map.Entry<String, Map<String, Variant>> callPropsEntry : mCallsProps.entrySet()) {
- String callPath = callPropsEntry.getKey();
- Map<String, Variant> callProps = callPropsEntry.getValue();
- if (Utils.parseOfonoCallState(getProp(callProps, "State", "")) == DriverCall.State.INCOMING) {
- VoiceCall call = RilOfono.sInstance.getOfonoInterface(VoiceCall.class, callPath);
- call.Answer();
- respondOk("acceptCall", result, null);
- }
- }
- } catch (Throwable t) {
- Rlog.e(TAG, "Error accepting call", privExc(t));
- respondExc("acceptCall", result, GENERIC_FAILURE, null);
- }
+ public Object acceptCall() {
+ for (Map.Entry<String, Map<String, Variant>> callPropsEntry : mCallsProps.entrySet()) {
+ String callPath = callPropsEntry.getKey();
+ Map<String, Variant> callProps = callPropsEntry.getValue();
+ if (Utils.parseOfonoCallState(getProp(callProps, "State", "")) == DriverCall.State.INCOMING) {
+ VoiceCall call = RilOfono.sInstance.getOfonoInterface(VoiceCall.class, callPath);
+ call.Answer();
+ return null;
}
- });
+ }
+
+ throw new CommandException(CommandException.Error.NO_SUCH_ELEMENT);
}
@RilMethod
- public void rejectCall(Message result) {
+ public Object rejectCall() {
// TODO RIL.java sends UDUB, which may not be the same as what we're indirectly asking oFono to do here
- hangupWaitingOrBackground(result);
+ return hangupWaitingOrBackground();
}
final DebouncedRunnable mFnNotifyCallStateChanged = new DebouncedRunnable() {
diff --git a/src/java/net/scintill/ril_ofono/DataConnModule.java b/src/java/net/scintill/ril_ofono/DataConnModule.java
index d9a5885..eb59c26 100644
--- a/src/java/net/scintill/ril_ofono/DataConnModule.java
+++ b/src/java/net/scintill/ril_ofono/DataConnModule.java
@@ -19,11 +19,11 @@
package net.scintill.ril_ofono;
-import android.os.Message;
import android.os.RegistrantList;
import android.telephony.Rlog;
import android.text.TextUtils;
+import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.RILConstants;
import com.android.internal.telephony.dataconnection.DataCallResponse;
@@ -43,15 +43,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static com.android.internal.telephony.CommandException.Error.GENERIC_FAILURE;
import static com.android.internal.telephony.CommandException.Error.MODE_NOT_SUPPORTED;
import static com.android.internal.telephony.CommandException.Error.NO_SUCH_ELEMENT;
import static com.android.internal.telephony.CommandException.Error.REQUEST_NOT_SUPPORTED;
-import static net.scintill.ril_ofono.RilOfono.privExc;
import static net.scintill.ril_ofono.RilOfono.privStr;
-import static net.scintill.ril_ofono.RilOfono.respondExc;
-import static net.scintill.ril_ofono.RilOfono.respondOk;
-import static net.scintill.ril_ofono.RilOfono.runOnDbusThread;
import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
/*package*/ class DataConnModule extends PropManager {
@@ -76,27 +71,22 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
@RilMethod
- public void getDataRegistrationState(Message response) {
- respondOk("getDataRegistrationState", response, new String[] {
+ public Object getDataRegistrationState() {
+ return new String[] {
// see e.g. GsmServiceStateTracker for the values and offsets, though some appear unused
""+(getProp(mConnManProps, "Attached", Boolean.FALSE) ? OfonoRegistrationState.registered : OfonoRegistrationState.unregistered).ts27007Creg,
"", "", // unused?
""+getProp(mConnManProps, "Bearer", OfonoNetworkTechnology._unknown).serviceStateInt,
- });
+ };
}
@RilMethod
- public void getDataCallList(Message result) {
- try {
- respondOk("getDataCallList", result, new PrivResponseOb(getDataCallList()));
- } catch (Throwable t) {
- Rlog.e(TAG, "Error getting data call list", t);
- respondExc("getDataCallList", result, GENERIC_FAILURE, null);
- }
+ public Object getDataCallList() {
+ return new PrivResponseOb(getDataCallListImpl());
}
@RilMethod
- public void setupDataCall(String radioTechnologyStr, String profile, String apnStr, String user, String password, String authType, String protocol, final Message result) {
+ public Object setupDataCall(String radioTechnologyStr, String profile, String apnStr, String user, String password, String authType, String protocol) {
OfonoNetworkTechnology radioTechnology = OfonoNetworkTechnology.fromSetupDataCallValue(Integer.valueOf(radioTechnologyStr));
OfonoNetworkTechnology currentRadioTechnology = getProp(mConnManProps, "Bearer", OfonoNetworkTechnology._unknown);
@@ -105,13 +95,11 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
// let's be stringent for now...
if (radioTechnology != currentRadioTechnology) {
Rlog.e(TAG, "Unable to provide requested radio technology "+radioTechnology+"("+radioTechnologyStr+"); current is "+currentRadioTechnology);
- respondExc("setupDataCall", result, MODE_NOT_SUPPORTED, null);
- return; // <---
+ throw new CommandException(MODE_NOT_SUPPORTED);
}
if (!profile.equals(String.valueOf(RILConstants.DATA_PROFILE_DEFAULT))) {
Rlog.e(TAG, "Unable to provide non-default data call profile "+profile);
- respondExc("setupDataCall", result, MODE_NOT_SUPPORTED, null);
- return; // <---
+ throw new CommandException(MODE_NOT_SUPPORTED);
}
final Apn apn = new Apn();
@@ -121,39 +109,23 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
apn.authType = Integer.parseInt(authType);
apn.protocol = protocol;
- runOnDbusThread(new Runnable() {
- @Override
- public void run() {
- try {
- Path ctxPath = mConnMan.AddContext("internet");
- ConnectionContext ctx = RilOfono.sInstance.getOfonoInterface(ConnectionContext.class, ctxPath.getPath());
- apn.setOnContext(ctx);
- setContextActive(ctx, true);
- respondOk("setupDataCall", result, new PrivResponseOb(getDataCallResponse(ctxPath.getPath(), ctx.GetProperties())));
- } catch (Throwable t) {
- Rlog.e(TAG, "data call creation failed", privExc(t));
- respondExc("setupDataCall", result, GENERIC_FAILURE, null);
- }
- }
- });
+ Path ctxPath = mConnMan.AddContext("internet");
+ ConnectionContext ctx = RilOfono.sInstance.getOfonoInterface(ConnectionContext.class, ctxPath.getPath());
+ apn.setOnContext(ctx);
+ setContextActive(ctx, true);
+ return new PrivResponseOb(getDataCallResponse(ctxPath.getPath(), ctx.GetProperties()));
}
@RilMethod
- public void deactivateDataCall(int cid, int reason, Message result) {
+ public Object deactivateDataCall(int cid, int reason) {
Rlog.d(TAG, "deactivateDataCall "+cid+" "+reason);
- try {
- String path = getPathFromUniqueIntId(cid);
- if (path == null) {
- respondExc("deactivateDatal", result, NO_SUCH_ELEMENT, null);
- return;
- }
- mConnMan.RemoveContext(new Path(path));
- forgetAboutUniqueId(path);
- respondOk("deactivateDataCall", result, null);
- } catch (Throwable t) {
- Rlog.e(TAG, "error stopping data call", t);
- respondExc("deactivateDataCall", result, GENERIC_FAILURE, null);
+ String path = getPathFromUniqueIntId(cid);
+ if (path == null) {
+ throw new CommandException(NO_SUCH_ELEMENT);
}
+ mConnMan.RemoveContext(new Path(path));
+ forgetAboutUniqueId(path);
+ return null;
}
private DataCallResponse getDataCallResponse(String dbusPath, Map<String, Variant> props) {
@@ -186,7 +158,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
return dcr;
}
- private List<DataCallResponse> getDataCallList() {
+ private List<DataCallResponse> getDataCallListImpl() {
List<DataCallResponse> list = new ArrayList<>();
//Rlog.d(TAG, "mConnectionsProps="+privStr(mConnectionsProps));
for (Map.Entry<String, Map<String, Variant>> connectionPropsEntry : mConnectionsProps.entrySet()) {
@@ -202,8 +174,8 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
@RilMethod
- public void setDataAllowed(boolean allowed, Message result) {
- Rlog.d(TAG, "setDataAllowed "+allowed);
+ public Object setDataAllowed(boolean allowed) {
+ Rlog.d(TAG, "setDataAllowed " + allowed);
/*
* from oFono docs:
* boolean Powered [readwrite]
@@ -211,19 +183,14 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
* this value to off detaches the modem from the
* Packet Domain network.
*/
- try {
- mConnMan.SetProperty("Powered", new Variant<>(allowed));
- respondOk("setDataAllowed", result, null);
- } catch (Throwable t) {
- Rlog.e(TAG, "Exception setting ConnMan.Powered to "+allowed, t);
- respondExc("setDataAllowed", result, GENERIC_FAILURE, null);
- }
+ mConnMan.SetProperty("Powered", new Variant<>(allowed));
+ return null;
}
@RilMethod
- public void setInitialAttachApn(String apn, String protocol, int authType, String username, String password, Message result) {
+ public Object setInitialAttachApn(String apn, String protocol, int authType, String username, String password) {
// not sure what this means, or whether it's applicable to oFono
- respondExc("setInitialAttachApn", result, REQUEST_NOT_SUPPORTED, null);
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
private void setContextActive(ConnectionContext ctx, boolean active) {
@@ -264,8 +231,9 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
private final DebouncedRunnable mFnNotifyDataNetworkState = new DebouncedRunnable() {
@Override
public void run() {
- Rlog.d(TAG, "notify dataNetworkState "+privStr(getDataCallList()));
- mDataNetworkStateRegistrants.notifyResult(getDataCallList());
+ Object calls = getDataCallListImpl();
+ Rlog.d(TAG, "notify dataNetworkState "+privStr(calls));
+ mDataNetworkStateRegistrants.notifyResult(calls);
}
};
diff --git a/src/java/net/scintill/ril_ofono/ModemModule.java b/src/java/net/scintill/ril_ofono/ModemModule.java
index b51cf2b..2d83b2a 100644
--- a/src/java/net/scintill/ril_ofono/ModemModule.java
+++ b/src/java/net/scintill/ril_ofono/ModemModule.java
@@ -19,11 +19,12 @@
package net.scintill.ril_ofono;
-import android.os.Message;
import android.os.RegistrantList;
import android.telephony.Rlog;
import android.telephony.SignalStrength;
+import com.android.internal.telephony.CommandException;
+
import org.freedesktop.DBus;
import org.freedesktop.dbus.Variant;
import org.ofono.Manager;
@@ -46,9 +47,6 @@ import static android.telephony.ServiceState.RIL_RADIO_TECHNOLOGY_UMTS;
import static android.telephony.ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN;
import static com.android.internal.telephony.CommandException.Error.GENERIC_FAILURE;
import static com.android.internal.telephony.CommandsInterface.RadioState;
-import static net.scintill.ril_ofono.RilOfono.respondExc;
-import static net.scintill.ril_ofono.RilOfono.respondOk;
-import static net.scintill.ril_ofono.RilOfono.runOnDbusThread;
import static net.scintill.ril_ofono.RilOfono.runOnMainThread;
import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
@@ -78,42 +76,41 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
@RilMethod
- public void getIMEI(Message result) {
+ public Object getIMEI() {
// TODO GSM-specific?
- respondOk("getIMEI", result, new PrivResponseOb(getProp(mModemProps, "Serial", "")), true);
+ return new PrivResponseOb(getProp(mModemProps, "Serial", ""));
}
@RilMethod
- public void getIMEISV(Message result) {
+ public Object getIMEISV() {
// TODO GSM-specific?
- respondOk("getIMEISV", result, new PrivResponseOb(getProp(mModemProps, "SoftwareVersionNumber", "")), true);
+ return new PrivResponseOb(getProp(mModemProps, "SoftwareVersionNumber", ""));
}
@RilMethod
- public void getSignalStrength(Message response) {
+ public Object getSignalStrength() {
// TODO I can't seem to find this on the ofono bus, but supposedly it's supported
// make up a low strength
- SignalStrength s = new SignalStrength(20, 1, -1, -1, -1, -1, -1, true);
- respondOk("getSignalStrength", response, s, true);
+ return new SignalStrength(20, 1, -1, -1, -1, -1, -1, true);
}
@RilMethod
- public void getVoiceRegistrationState(Message response) {
+ public Object getVoiceRegistrationState() {
OfonoRegistrationState state = getProp(mNetRegProps, "Status", OfonoRegistrationState.unknown);
if (!state.isRegistered()) {
- respondOk("getVoiceRegistrationState", response, new String[]{ ""+state.ts27007Creg, "-1", "-1" });
+ return new String[]{ ""+state.ts27007Creg, "-1", "-1" };
} else {
- respondOk("getVoiceRegistrationState", response, new PrivResponseOb(new String[]{
+ return new PrivResponseOb(new String[]{
""+state.ts27007Creg,
getProp(mNetRegProps, "LocationAreaCode", "-1"),
getProp(mNetRegProps, "CellId", "-1"),
""+getProp(mNetRegProps, "Technology", OfonoNetworkTechnology._unknown).serviceStateInt,
- }));
+ });
}
}
@RilMethod
- public void getOperator(Message response) {
+ public Object getOperator() {
String STAR_EMOJI = "🌠";
boolean registered = getProp(mNetRegProps, "Status", OfonoRegistrationState.unknown).isRegistered();
@@ -122,46 +119,41 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
String mnc = getProp(mNetRegProps, "MobileNetworkCode", "");
name = STAR_EMOJI + name + STAR_EMOJI; // make it obvious we're running this RIL
if (registered && mcc.length() > 0 && mnc.length() > 0 && name.length() > 0) {
- respondOk("getOperator", response, new String[] {
+ return new String[] {
name, name, /* TODO does Ofono offer distinct short and long names? */
mcc+mnc
- });
+ };
} else {
- respondOk("getOperator", response, new String[] { null, null, null });
+ return new String[] { null, null, null };
}
}
@RilMethod
- public void setRadioPower(final boolean on, final Message response) {
+ public Object setRadioPower(final boolean on) {
Rlog.v(TAG, "setRadioPower("+on+")");
- runOnDbusThread(new Runnable() {
- @Override
- public void run() {
- mModem.SetProperty("Online", new Variant<>(on));
- respondOk("setRadioPower", response, null);
- }
- });
+ mModem.SetProperty("Online", new Variant<>(on));
+ return null;
}
@RilMethod
- public void getNetworkSelectionMode(Message response) {
+ public Object getNetworkSelectionMode() {
String mode = getProp(mNetRegProps, "Mode", (String)null);
if (mode == null) {
- respondExc("getNetworkSelectionMode", response, GENERIC_FAILURE, null);
+ throw new CommandException(GENERIC_FAILURE);
} else {
- respondOk("getNetworkSelectionMode", response, new int[]{ mode.equals("manual") ? 1 : 0 });
+ return new int[]{ mode.equals("manual") ? 1 : 0 };
}
}
@RilMethod
- public void getBasebandVersion(Message response) {
- respondOk("getBaseBandVersion", response, getProp(mModemProps, "Revision", ""), true);
+ public Object getBasebandVersion() {
+ return getProp(mModemProps, "Revision", "");
}
@RilMethod
- public void getVoiceRadioTechnology(Message result) {
- respondOk("getVoiceRadioTechnology", result, getVoiceRadioTechnologyAsyncResult());
+ public Object getVoiceRadioTechnology() {
+ return getVoiceRadioTechnologyAsyncResult();
}
protected void onPropChange(Modem modem, String name, Variant value) {
diff --git a/src/java/net/scintill/ril_ofono/RilInterface.java b/src/java/net/scintill/ril_ofono/RilInterface.java
new file mode 100644
index 0000000..171d412
--- /dev/null
+++ b/src/java/net/scintill/ril_ofono/RilInterface.java
@@ -0,0 +1,291 @@
+/*
+ * 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 com.android.internal.telephony.UUSInfo;
+import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
+import com.android.internal.telephony.dataconnection.DataProfile;
+import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
+
+interface RilInterface {
+ Object getImsRegistrationState();
+
+ Object setSuppServiceNotifications(boolean enable);
+
+ Object supplyIccPin(String pin);
+
+ Object supplyIccPinForApp(String pin, String aid);
+
+ Object supplyIccPuk(String puk, String newPin);
+
+ Object supplyIccPukForApp(String puk, String newPin, String aid);
+
+ Object supplyIccPin2(String pin2);
+
+ Object supplyIccPin2ForApp(String pin2, String aid);
+
+ Object supplyIccPuk2(String puk2, String newPin2);
+
+ Object supplyIccPuk2ForApp(String puk2, String newPin2, String aid);
+
+ Object changeIccPin(String oldPin, String newPin);
+
+ Object changeIccPinForApp(String oldPin, String newPin, String aidPtr);
+
+ Object changeIccPin2(String oldPin2, String newPin2);
+
+ Object changeIccPin2ForApp(String oldPin2, String newPin2, String aidPtr);
+
+ Object changeBarringPassword(String facility, String oldPwd, String newPwd);
+
+ Object supplyDepersonalization(String netpin, String type);
+
+ Object getCurrentCalls();
+
+ Object getPDPContextList();
+
+ Object getDataCallList();
+
+ Object getDataCallProfile(int appType);
+
+ Object setDataProfile(DataProfile[] dps);
+
+ Object setDataAllowed(boolean allowed);
+
+ Object dial(String address, int clirMode);
+
+ Object dial(String address, int clirMode, UUSInfo uusInfo);
+
+ Object hangupForegroundResumeBackground();
+
+ Object switchWaitingOrHoldingAndActive();
+
+ Object conference();
+
+ Object setPreferredVoicePrivacy(boolean enable);
+
+ Object getPreferredVoicePrivacy();
+
+ Object separateConnection(int gsmIndex);
+
+ Object acceptCall();
+
+ Object rejectCall();
+
+ Object explicitCallTransfer();
+
+ Object getLastCallFailCause();
+
+ Object getLastPdpFailCause();
+
+ Object getLastDataCallFailCause();
+
+ Object setMute(boolean enableMute);
+
+ Object getMute();
+
+ Object getSignalStrength();
+
+ Object getVoiceRegistrationState();
+
+ Object getIMSI();
+
+ Object getIMSIForApp(String aid);
+
+ Object getIMEI();
+
+ Object getIMEISV();
+
+ Object hangupConnection(int gsmIndex);
+
+ Object hangupWaitingOrBackground();
+
+ Object getDataRegistrationState();
+
+ Object getOperator();
+
+ Object sendDtmf(char c);
+
+ Object startDtmf(char c);
+
+ Object stopDtmf();
+
+ Object sendBurstDtmf(String dtmfString, int on, int off);
+
+ Object sendSMS(String smscPDUStr, String pduStr);
+
+ Object sendSMSExpectMore(String smscPDU, String pdu);
+
+ Object sendCdmaSms(byte[] pdu);
+
+ Object sendImsGsmSms(String smscPDU, String pdu, int retry, int messageRef);
+
+ Object sendImsCdmaSms(byte[] pdu, int retry, int messageRef);
+
+ Object deleteSmsOnSim(int index);
+
+ Object deleteSmsOnRuim(int index);
+
+ Object writeSmsToSim(int status, String smsc, String pdu);
+
+ Object writeSmsToRuim(int status, String pdu);
+
+ Object setRadioPower(boolean on);
+
+ Object acknowledgeLastIncomingGsmSms(boolean success, int cause);
+
+ Object acknowledgeLastIncomingCdmaSms(boolean success, int cause);
+
+ Object acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu);
+
+ Object iccIO(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2);
+
+ Object iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, String aid);
+
+ Object queryCLIP();
+
+ Object getCLIR();
+
+ Object setCLIR(int clirMode);
+
+ Object queryCallWaiting(int serviceClass);
+
+ Object setCallWaiting(boolean enable, int serviceClass);
+
+ Object setCallForward(int action, int cfReason, int serviceClass, String number, int timeSeconds);
+
+ Object queryCallForwardStatus(int cfReason, int serviceClass, String number);
+
+ Object setNetworkSelectionModeAutomatic();
+
+ Object setNetworkSelectionModeManual(String operatorNumeric);
+
+ Object getNetworkSelectionMode();
+
+ Object getAvailableNetworks();
+
+ Object getBasebandVersion();
+
+ Object queryFacilityLock(String facility, String password, int serviceClass);
+
+ Object queryFacilityLockForApp(String facility, String password, int serviceClass, String appId);
+
+ Object setFacilityLock(String facility, boolean lockState, String password, int serviceClass);
+
+ Object setFacilityLockForApp(String facility, boolean lockState, String password, int serviceClass, String appId);
+
+ Object sendUSSD(String ussdString);
+
+ Object cancelPendingUssd();
+
+ Object resetRadio();
+
+ Object setBandMode(int bandMode);
+
+ Object queryAvailableBandMode();
+
+ Object setPreferredNetworkType(int networkType);
+
+ Object getPreferredNetworkType();
+
+ Object getNeighboringCids();
+
+ Object setLocationUpdates(boolean enable);
+
+ Object getSmscAddress();
+
+ Object setSmscAddress(String address);
+
+ Object reportSmsMemoryStatus(boolean available);
+
+ Object reportStkServiceIsRunning();
+
+ Object invokeOemRilRequestRaw(byte[] data);
+
+ Object invokeOemRilRequestStrings(String[] strings);
+
+ Object sendTerminalResponse(String contents);
+
+ Object sendEnvelope(String contents);
+
+ Object sendEnvelopeWithStatus(String contents);
+
+ Object handleCallSetupRequestFromSim(boolean accept);
+
+ Object setGsmBroadcastActivation(boolean activate);
+
+ Object setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config);
+
+ Object getGsmBroadcastConfig();
+
+ Object getDeviceIdentity();
+
+ Object getCDMASubscription();
+
+ Object sendCDMAFeatureCode(String FeatureCode);
+
+ Object queryCdmaRoamingPreference();
+
+ Object setCdmaRoamingPreference(int cdmaRoamingType);
+
+ Object setCdmaSubscriptionSource(int cdmaSubscriptionType);
+
+ Object getCdmaSubscriptionSource();
+
+ Object setTTYMode(int ttyMode);
+
+ Object queryTTYMode();
+
+ Object setupDataCall(String radioTechnology, String profile, String apn, String user, String password, String authType, String protocol);
+
+ Object deactivateDataCall(int cid, int reason);
+
+ Object setCdmaBroadcastActivation(boolean activate);
+
+ Object setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs);
+
+ Object getCdmaBroadcastConfig();
+
+ Object exitEmergencyCallbackMode();
+
+ Object getIccCardStatus();
+
+ Object requestIsimAuthentication(String nonce);
+
+ Object requestIccSimAuthentication(int authContext, String data, String aid);
+
+ Object getVoiceRadioTechnology();
+
+ Object getCellInfoList();
+
+ Object setCellInfoListRate(int rateInMillis);
+
+ Object setInitialAttachApn(String apn, String protocol, int authType, String username, String password);
+
+ Object nvReadItem(int itemID);
+
+ Object nvWriteItem(int itemID, String itemValue);
+
+ Object nvWriteCdmaPrl(byte[] preferredRoamingList);
+
+ Object nvResetConfig(int resetType);
+
+ Object getHardwareConfig();
+}
diff --git a/src/java/net/scintill/ril_ofono/RilOfono.java b/src/java/net/scintill/ril_ofono/RilOfono.java
index fa33276..d802df5 100644
--- a/src/java/net/scintill/ril_ofono/RilOfono.java
+++ b/src/java/net/scintill/ril_ofono/RilOfono.java
@@ -17,23 +17,17 @@
* along with ril_ofono. If not, see <http://www.gnu.org/licenses/>.
*/
-
package net.scintill.ril_ofono;
-import android.content.Context;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
-import android.os.Registrant;
import android.os.StrictMode;
import android.telephony.Rlog;
import android.text.TextUtils;
-import com.android.internal.telephony.BaseCommands;
import com.android.internal.telephony.CommandException;
-import com.android.internal.telephony.CommandsInterface;
-import com.android.internal.telephony.RILConstants;
import com.android.internal.telephony.UUSInfo;
import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
import com.android.internal.telephony.dataconnection.DataProfile;
@@ -51,17 +45,19 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
import static com.android.internal.telephony.CommandException.Error.REQUEST_NOT_SUPPORTED;
-import static net.scintill.ril_ofono.Utils.getCallerMethodName;
+import static com.android.internal.telephony.CommandsInterface.RadioState;
-public class RilOfono extends BaseCommands implements CommandsInterface {
+public class RilOfono implements RilInterface {
/*package*/ static final String TAG = "RilOfono";
- private static final int BUILD_NUMBER = 11;
+ private static final int BUILD_NUMBER = 12;
/*package*/ static final boolean LOG_POTENTIALLY_SENSITIVE_INFO = true;
/*
@@ -72,6 +68,7 @@ public class RilOfono extends BaseCommands implements CommandsInterface {
private static final String DBUS_ADDRESS = "unix:path=/dev/socket/dbus";
+ private RilWrapper mRilWrapper;
private Handler mDbusHandler;
private Handler mMainHandler;
@@ -86,12 +83,11 @@ public class RilOfono extends BaseCommands implements CommandsInterface {
/*package*/ static RilOfono sInstance;
- public RilOfono(Context context, int preferredNetworkType, int cdmaSubscription, Integer instanceId) {
- super(context);
+ /*package*/ RilOfono(final RilWrapper rilWrapper) {
sInstance = this;
Rlog.d(TAG, "RilOfono "+BUILD_NUMBER+" starting");
- mPhoneType = RILConstants.NO_PHONE;
+ mRilWrapper = rilWrapper;
HandlerThread dbusThread = new HandlerThread("RilOfonoDbusThread");
dbusThread.start();
@@ -107,12 +103,12 @@ public class RilOfono extends BaseCommands implements CommandsInterface {
try {
mDbus = DBusConnection.getConnection(DBUS_ADDRESS);
- mModemModule = new ModemModule(mVoiceNetworkStateRegistrants, mVoiceRadioTechChangedRegistrants);
- mSmsModule = new SmsModule(new DynamicRegistrantListFromField("mGsmSmsRegistrant")); // TODO gsm-specific
- mSimModule = new SimModule(mIccStatusChangedRegistrants);
- mCallModule = new CallModule(mCallStateRegistrants);
- mDataConnModule = new DataConnModule(mDataNetworkStateRegistrants);
- mSupplSvcsModule = new SupplementaryServicesModule(new DynamicRegistrantListFromField("mUSSDRegistrant"));
+ mModemModule = new ModemModule(mRilWrapper.mVoiceNetworkStateRegistrants, mRilWrapper.mVoiceRadioTechChangedRegistrants);
+ mSmsModule = new SmsModule(mRilWrapper.mGsmSmsRegistrants); // TODO gsm-specific
+ mSimModule = new SimModule(mRilWrapper.mIccStatusChangedRegistrants);
+ mCallModule = new CallModule(mRilWrapper.mCallStateRegistrants);
+ mDataConnModule = new DataConnModule(mRilWrapper.mDataNetworkStateRegistrants);
+ mSupplSvcsModule = new SupplementaryServicesModule(mRilWrapper.mUSSDRegistrants);
mModemModule.onModemChange(false); // initialize starting state
} catch (DBusException e) {
logException("RilOfono", e);
@@ -130,7 +126,7 @@ public class RilOfono extends BaseCommands implements CommandsInterface {
@Override
public void run() {
// see RIL.java for RIL_UNSOL_RIL_CONNECTED
- setRadioPower(false, cbToMsg(new Handler.Callback() {
+ mRilWrapper.setRadioPower(false, cbToMsg(new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
AsyncResult ar = (AsyncResult) msg.obj;
@@ -144,832 +140,681 @@ public class RilOfono extends BaseCommands implements CommandsInterface {
}
}));
Rlog.d(TAG, "notifyRegistrantsRilConnectionChanged");
- updateRilConnection(RIL_VERSION);
+ mRilWrapper.updateRilConnection(RIL_VERSION);
}
});
// TODO call VoiceManager GetCalls() ? oFono docs on that method suggest you should at startup
}
@Override
- @RilMethod
- public void getImsRegistrationState(Message result) {
- respondExc("getImsRegistrationState", result, REQUEST_NOT_SUPPORTED, null);
+ public Object getImsRegistrationState() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setSuppServiceNotifications(boolean enable, Message result) {
- respondExc("setSuppServiceNotifications", result, REQUEST_NOT_SUPPORTED, null);
+ public Object setSuppServiceNotifications(boolean enable) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void supplyIccPin(String pin, Message result) {
- supplyIccPinForApp(pin, null, result);
+ public Object supplyIccPin(String pin) {
+ return supplyIccPinForApp(pin, null);
}
@Override
- @RilMethod
- public void supplyIccPinForApp(String pin, String aid, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object supplyIccPinForApp(String pin, String aid) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void supplyIccPuk(String puk, String newPin, Message result) {
- supplyIccPukForApp(puk, newPin, null, result);
+ public Object supplyIccPuk(String puk, String newPin) {
+ return supplyIccPukForApp(puk, newPin, null);
}
@Override
- @RilMethod
- public void supplyIccPukForApp(String puk, String newPin, String aid, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object supplyIccPukForApp(String puk, String newPin, String aid) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void supplyIccPin2(String pin2, Message result) {
- supplyIccPin2ForApp(pin2, null, result);
+ public Object supplyIccPin2(String pin2) {
+ return supplyIccPin2ForApp(pin2, null);
}
@Override
- @RilMethod
- public void supplyIccPin2ForApp(String pin2, String aid, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object supplyIccPin2ForApp(String pin2, String aid) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void supplyIccPuk2(String puk2, String newPin2, Message result) {
- supplyIccPuk2ForApp(puk2, newPin2, null, result);
+ public Object supplyIccPuk2(String puk2, String newPin2) {
+ return supplyIccPuk2ForApp(puk2, newPin2, null);
}
@Override
- @RilMethod
- public void supplyIccPuk2ForApp(String puk2, String newPin2, String aid, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object supplyIccPuk2ForApp(String puk2, String newPin2, String aid) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void changeIccPin(String oldPin, String newPin, Message result) {
- changeIccPin2ForApp(oldPin, newPin, null, result);
+ public Object changeIccPin(String oldPin, String newPin) {
+ return changeIccPin2ForApp(oldPin, newPin, null);
}
@Override
- @RilMethod
- public void changeIccPinForApp(String oldPin, String newPin, String aidPtr, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object changeIccPinForApp(String oldPin, String newPin, String aidPtr) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void changeIccPin2(String oldPin2, String newPin2, Message result) {
- changeIccPin2ForApp(oldPin2, newPin2, null, result);
+ public Object changeIccPin2(String oldPin2, String newPin2) {
+ return changeIccPin2ForApp(oldPin2, newPin2, null);
}
@Override
- @RilMethod
- public void changeIccPin2ForApp(String oldPin2, String newPin2, String aidPtr, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object changeIccPin2ForApp(String oldPin2, String newPin2, String aidPtr) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void changeBarringPassword(String facility, String oldPwd, String newPwd, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object changeBarringPassword(String facility, String oldPwd, String newPwd) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void supplyDepersonalization(String netpin, String type, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object supplyDepersonalization(String netpin, String type) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getCurrentCalls(Message result) {
- mCallModule.getCurrentCalls(result);
+ public Object getCurrentCalls() {
+ return mCallModule.getCurrentCalls();
}
@Override
- @RilMethod
- public void getPDPContextList(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object getPDPContextList() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getDataCallList(Message result) {
- mDataConnModule.getDataCallList(result);
+ public Object getDataCallList() {
+ return mDataConnModule.getDataCallList();
}
@Override
- @RilMethod
- public void getDataCallProfile(int appType, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object getDataCallProfile(int appType) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setDataProfile(DataProfile[] dps, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object setDataProfile(DataProfile[] dps) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setDataAllowed(boolean allowed, Message result) {
- mDataConnModule.setDataAllowed(allowed, result);
+ public Object setDataAllowed(boolean allowed) {
+ return mDataConnModule.setDataAllowed(allowed);
}
@Override
- @RilMethod
- public void dial(String address, int clirMode, Message result) {
- mCallModule.dial(address, clirMode, result);
+ public Object dial(String address, int clirMode) {
+ return mCallModule.dial(address, clirMode);
}
@Override
- @RilMethod
- public void dial(String address, int clirMode, UUSInfo uusInfo, Message result) {
- mCallModule.dial(address, clirMode, uusInfo, result);
+ public Object dial(String address, int clirMode, UUSInfo uusInfo) {
+ return mCallModule.dial(address, clirMode, uusInfo);
}
@Override
- @RilMethod
- public void hangupForegroundResumeBackground(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object hangupForegroundResumeBackground() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void switchWaitingOrHoldingAndActive(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object switchWaitingOrHoldingAndActive() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void conference(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object conference() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setPreferredVoicePrivacy(boolean enable, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object setPreferredVoicePrivacy(boolean enable) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getPreferredVoicePrivacy(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object getPreferredVoicePrivacy() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void separateConnection(int gsmIndex, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object separateConnection(int gsmIndex) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void acceptCall(Message result) {
- mCallModule.acceptCall(result);
+ public Object acceptCall() {
+ return mCallModule.acceptCall();
}
@Override
- @RilMethod
- public void rejectCall(Message result) {
- mCallModule.rejectCall(result);
+ public Object rejectCall() {
+ return mCallModule.rejectCall();
}
@Override
- @RilMethod
- public void explicitCallTransfer(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object explicitCallTransfer() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getLastCallFailCause(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object getLastCallFailCause() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getLastPdpFailCause(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object getLastPdpFailCause() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getLastDataCallFailCause(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object getLastDataCallFailCause() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setMute(boolean enableMute, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setMute(boolean enableMute) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getMute(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object getMute() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getSignalStrength(Message response) {
- mModemModule.getSignalStrength(response);
+ public Object getSignalStrength() {
+ return mModemModule.getSignalStrength();
}
@Override
- @RilMethod
- public void getVoiceRegistrationState(Message response) {
- mModemModule.getVoiceRegistrationState(response);
+ public Object getVoiceRegistrationState() {
+ return mModemModule.getVoiceRegistrationState();
}
@Override
- @RilMethod
- public void getIMSI(Message result) {
- getIMSIForApp(null, result);
+ public Object getIMSI() {
+ return getIMSIForApp(null);
}
@Override
- @RilMethod
- public void getIMSIForApp(String aid, Message result) {
- mSimModule.getIMSIForApp(aid, result);
+ public Object getIMSIForApp(String aid) {
+ return mSimModule.getIMSIForApp(aid);
}
@Override
- @RilMethod
- public void getIMEI(Message result) {
- mModemModule.getIMEI(result);
+ public Object getIMEI() {
+ return mModemModule.getIMEI();
}
@Override
- @RilMethod
- public void getIMEISV(Message result) {
- mModemModule.getIMEISV(result);
+ public Object getIMEISV() {
+ return mModemModule.getIMEISV();
}
@Override
- @RilMethod
- public void hangupConnection(int gsmIndex, Message result) {
- mCallModule.hangupConnection(gsmIndex, result);
+ public Object hangupConnection(int gsmIndex) {
+ return mCallModule.hangupConnection(gsmIndex);
}
@Override
- @RilMethod
- public void hangupWaitingOrBackground(Message result) {
- mCallModule.hangupWaitingOrBackground(result);
+ public Object hangupWaitingOrBackground() {
+ return mCallModule.hangupWaitingOrBackground();
}
@Override
- @RilMethod
- public void getDataRegistrationState(Message response) {
- mDataConnModule.getDataRegistrationState(response);
+ public Object getDataRegistrationState() {
+ return mDataConnModule.getDataRegistrationState();
}
@Override
- @RilMethod
- public void getOperator(Message response) {
- mModemModule.getOperator(response);
+ public Object getOperator() {
+ return mModemModule.getOperator();
}
@Override
- @RilMethod
- public void sendDtmf(char c, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object sendDtmf(char c) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void startDtmf(char c, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object startDtmf(char c) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void stopDtmf(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object stopDtmf() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void sendBurstDtmf(String dtmfString, int on, int off, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object sendBurstDtmf(String dtmfString, int on, int off) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void sendSMS(String smscPDUStr, String pduStr, Message response) {
- mSmsModule.sendSMS(smscPDUStr, pduStr, response);
+ public Object sendSMS(String smscPDUStr, String pduStr) {
+ return mSmsModule.sendSMS(smscPDUStr, pduStr);
}
@Override
- @RilMethod
- public void sendSMSExpectMore(String smscPDU, String pdu, Message result) {
+ public Object sendSMSExpectMore(String smscPDU, String pdu) {
// TODO can oFono benefit from knowing to "expect more"?
- sendSMS(smscPDU, pdu, result);
+ return sendSMS(smscPDU, pdu);
}
@Override
- @RilMethod
- public void sendCdmaSms(byte[] pdu, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object sendCdmaSms(byte[] pdu) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void sendImsGsmSms(String smscPDU, String pdu, int retry, int messageRef, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object sendImsGsmSms(String smscPDU, String pdu, int retry, int messageRef) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void sendImsCdmaSms(byte[] pdu, int retry, int messageRef, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object sendImsCdmaSms(byte[] pdu, int retry, int messageRef) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void deleteSmsOnSim(int index, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object deleteSmsOnSim(int index) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void deleteSmsOnRuim(int index, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object deleteSmsOnRuim(int index) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void writeSmsToSim(int status, String smsc, String pdu, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object writeSmsToSim(int status, String smsc, String pdu) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void writeSmsToRuim(int status, String pdu, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object writeSmsToRuim(int status, String pdu) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setRadioPower(boolean on, Message response) {
- mModemModule.setRadioPower(on, response);
+ public Object setRadioPower(boolean on) {
+ return mModemModule.setRadioPower(on);
}
@Override
- @RilMethod
- public void acknowledgeLastIncomingGsmSms(boolean success, int cause, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object acknowledgeLastIncomingGsmSms(boolean success, int cause) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object acknowledgeLastIncomingCdmaSms(boolean success, int cause) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void iccIO(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, Message response) {
- iccIOForApp(command, fileid, path, p1, p2, p3, data, pin2, null, response);
+ public Object iccIO(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2) {
+ return iccIOForApp(command, fileid, path, p1, p2, p3, data, pin2, null);
}
@Override
- @RilMethod
- public void iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, String aid, Message response) {
- mSimModule.iccIOForApp(command, fileid, path, p1, p2, p3, data, pin2, aid, response);
+ public Object iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, String aid) {
+ return mSimModule.iccIOForApp(command, fileid, path, p1, p2, p3, data, pin2, aid);
}
@Override
- @RilMethod
- public void queryCLIP(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object queryCLIP() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getCLIR(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object getCLIR() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setCLIR(int clirMode, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setCLIR(int clirMode) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void queryCallWaiting(int serviceClass, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object queryCallWaiting(int serviceClass) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setCallWaiting(boolean enable, int serviceClass, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setCallWaiting(boolean enable, int serviceClass) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setCallForward(int action, int cfReason, int serviceClass, String number, int timeSeconds, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setCallForward(int action, int cfReason, int serviceClass, String number, int timeSeconds) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void queryCallForwardStatus(int cfReason, int serviceClass, String number, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object queryCallForwardStatus(int cfReason, int serviceClass, String number) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setNetworkSelectionModeAutomatic(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setNetworkSelectionModeAutomatic() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setNetworkSelectionModeManual(String operatorNumeric, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setNetworkSelectionModeManual(String operatorNumeric) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getNetworkSelectionMode(Message response) {
- mModemModule.getNetworkSelectionMode(response);
+ public Object getNetworkSelectionMode() {
+ return mModemModule.getNetworkSelectionMode();
}
@Override
- @RilMethod
- public void getAvailableNetworks(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object getAvailableNetworks() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getBasebandVersion(Message response) {
- mModemModule.getBasebandVersion(response);
+ public Object getBasebandVersion() {
+ return mModemModule.getBasebandVersion();
}
@Override
- @RilMethod
- public void queryFacilityLock(String facility, String password, int serviceClass, Message response) {
- queryFacilityLockForApp(facility, password, serviceClass, null, response);
+ public Object queryFacilityLock(String facility, String password, int serviceClass) {
+ return queryFacilityLockForApp(facility, password, serviceClass, null);
}
@Override
- @RilMethod
- public void queryFacilityLockForApp(String facility, String password, int serviceClass, String appId, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object queryFacilityLockForApp(String facility, String password, int serviceClass, String appId) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setFacilityLock(String facility, boolean lockState, String password, int serviceClass, Message response) {
- setFacilityLockForApp(facility, lockState, password, serviceClass, null, response);
+ public Object setFacilityLock(String facility, boolean lockState, String password, int serviceClass) {
+ return setFacilityLockForApp(facility, lockState, password, serviceClass, null);
}
@Override
- @RilMethod
- public void setFacilityLockForApp(String facility, boolean lockState, String password, int serviceClass, String appId, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setFacilityLockForApp(String facility, boolean lockState, String password, int serviceClass, String appId) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void sendUSSD(String ussdString, Message response) {
- mSupplSvcsModule.sendUSSD(ussdString, response);
+ public Object sendUSSD(String ussdString) {
+ return mSupplSvcsModule.sendUSSD(ussdString);
}
@Override
- @RilMethod
- public void cancelPendingUssd(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object cancelPendingUssd() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void resetRadio(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object resetRadio() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setBandMode(int bandMode, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setBandMode(int bandMode) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void queryAvailableBandMode(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object queryAvailableBandMode() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setPreferredNetworkType(int networkType, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setPreferredNetworkType(int networkType) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getPreferredNetworkType(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object getPreferredNetworkType() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getNeighboringCids(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object getNeighboringCids() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setLocationUpdates(boolean enable, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setLocationUpdates(boolean enable) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getSmscAddress(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object getSmscAddress() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setSmscAddress(String address, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object setSmscAddress(String address) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void reportSmsMemoryStatus(boolean available, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object reportSmsMemoryStatus(boolean available) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void reportStkServiceIsRunning(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object reportStkServiceIsRunning() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void invokeOemRilRequestRaw(byte[] data, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null); }
-
- @Override
- @RilMethod
- public void invokeOemRilRequestStrings(String[] strings, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null); }
-
- @Override
- @RilMethod
- public void sendTerminalResponse(String contents, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object invokeOemRilRequestRaw(byte[] data) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void sendEnvelope(String contents, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object invokeOemRilRequestStrings(String[] strings) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void sendEnvelopeWithStatus(String contents, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object sendTerminalResponse(String contents) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void handleCallSetupRequestFromSim(boolean accept, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object sendEnvelope(String contents) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setGsmBroadcastActivation(boolean activate, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object sendEnvelopeWithStatus(String contents) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object handleCallSetupRequestFromSim(boolean accept) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getGsmBroadcastConfig(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setGsmBroadcastActivation(boolean activate) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getDeviceIdentity(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getCDMASubscription(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object getGsmBroadcastConfig() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void sendCDMAFeatureCode(String FeatureCode, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object getDeviceIdentity() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setPhoneType(int phoneType) {
- mPhoneType = phoneType;
+ public Object getCDMASubscription() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void queryCdmaRoamingPreference(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object sendCDMAFeatureCode(String FeatureCode) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setCdmaRoamingPreference(int cdmaRoamingType, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object queryCdmaRoamingPreference() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setCdmaSubscriptionSource(int cdmaSubscriptionType, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setCdmaRoamingPreference(int cdmaRoamingType) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getCdmaSubscriptionSource(Message response) {
- respondExc("getCdmaSubscriptionSource", response, REQUEST_NOT_SUPPORTED, null);
+ public Object setCdmaSubscriptionSource(int cdmaSubscriptionType) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setTTYMode(int ttyMode, Message response) {
- respondExc("setTTYMode", response, REQUEST_NOT_SUPPORTED, null);
+ public Object getCdmaSubscriptionSource() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void queryTTYMode(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setTTYMode(int ttyMode) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setupDataCall(String radioTechnology, String profile, String apn, String user, String password, String authType, String protocol, Message result) {
- mDataConnModule.setupDataCall(radioTechnology, profile, apn, user, password, authType, protocol, result);
+ public Object queryTTYMode() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void deactivateDataCall(int cid, int reason, Message result) {
- mDataConnModule.deactivateDataCall(cid, reason, result);
+ public Object setupDataCall(String radioTechnology, String profile, String apn, String user, String password, String authType, String protocol) {
+ return mDataConnModule.setupDataCall(radioTechnology, profile, apn, user, password, authType, protocol);
}
@Override
- @RilMethod
- public void setCdmaBroadcastActivation(boolean activate, Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null, true);
+ public Object deactivateDataCall(int cid, int reason) {
+ return mDataConnModule.deactivateDataCall(cid, reason);
}
@Override
- @RilMethod
- public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null, true);
+ public Object setCdmaBroadcastActivation(boolean activate) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getCdmaBroadcastConfig(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null, true);
+ public Object setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void exitEmergencyCallbackMode(Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object getCdmaBroadcastConfig() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getIccCardStatus(Message result) {
- mSimModule.getIccCardStatus(result);
+ public Object exitEmergencyCallbackMode() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void requestIsimAuthentication(String nonce, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object getIccCardStatus() {
+ return mSimModule.getIccCardStatus();
}
@Override
- @RilMethod
- public void requestIccSimAuthentication(int authContext, String data, String aid, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object requestIsimAuthentication(String nonce) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getVoiceRadioTechnology(Message result) {
- mModemModule.getVoiceRadioTechnology(result);
+ public Object requestIccSimAuthentication(int authContext, String data, String aid) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getCellInfoList(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object getVoiceRadioTechnology() {
+ return mModemModule.getVoiceRadioTechnology();
}
@Override
- @RilMethod
- public void setCellInfoListRate(int rateInMillis, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object getCellInfoList() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void setInitialAttachApn(String apn, String protocol, int authType, String username, String password, Message result) {
- mDataConnModule.setInitialAttachApn(apn, protocol, authType, username, password, result);
+ public Object setCellInfoListRate(int rateInMillis) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void nvReadItem(int itemID, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object setInitialAttachApn(String apn, String protocol, int authType, String username, String password) {
+ return mDataConnModule.setInitialAttachApn(apn, protocol, authType, username, password);
}
@Override
- @RilMethod
- public void nvWriteItem(int itemID, String itemValue, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object nvReadItem(int itemID) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void nvWriteCdmaPrl(byte[] preferredRoamingList, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object nvWriteItem(int itemID, String itemValue) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void nvResetConfig(int resetType, Message response) {
- respondExc(getCallerMethodName(), response, REQUEST_NOT_SUPPORTED, null);
+ public Object nvWriteCdmaPrl(byte[] preferredRoamingList) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public void getHardwareConfig(Message result) {
- respondExc(getCallerMethodName(), result, REQUEST_NOT_SUPPORTED, null);
+ public Object nvResetConfig(int resetType) {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- @RilMethod
- public boolean needsOldRilFeature(String feature) {
- return false;
+ public Object getHardwareConfig() {
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
- @Override
- @RilMethod // just to make it accessible in this package
- protected void setRadioState(RadioState newState) {
- super.setRadioState(newState);
+ /*package*/ void setRadioState(RadioState newState) {
+ mRilWrapper.setRadioStateHelper(newState);
}
/*package*/ static void logException(String m, Throwable t) {
Rlog.e(TAG, "Uncaught exception in "+m, t);
}
- private void updateRilConnection(int version) {
- this.mRilVersion = version;
- if (mRilConnectedRegistrants != null) {
- mRilConnectedRegistrants.notifyResult(version);
- }
- }
-
// TODO
// things I noticed BaseCommands overrides but has an empty implementation we might need to override:
// getModemCapability(),
@@ -1031,11 +876,16 @@ public class RilOfono extends BaseCommands implements CommandsInterface {
}
}
+ private static final Set<String> quietRespondOk = new HashSet<>(Arrays.asList(new String[]{
+ "getSignalStrength", "getBasebandVersion", "getIMSIForApp", "getIccCardStatus", "iccIO", "iccIOForApp"
+ }));
+ private static final Set<String> quietRespondExc = new HashSet<>(Arrays.asList(new String[]{
+ "setCdmaBroadcastActivation", "setCdmaBroadcastConfig",
+ }));
+
/*package*/ static void respondOk(String caller, Message response, Object o) {
- respondOk(caller, response, o, false);
- }
+ boolean quiet = quietRespondOk.contains(caller);
- /*package*/ static void respondOk(String caller, Message response, Object o, boolean quiet) {
PrivResponseOb privResponseOb = null;
if (o instanceof PrivResponseOb) {
privResponseOb = (PrivResponseOb) o;
@@ -1052,11 +902,9 @@ public class RilOfono extends BaseCommands implements CommandsInterface {
}
}
- /*package*/ static void respondExc(String caller, Message response, CommandException.Error err, Object o) {
- respondExc(caller, response, err, o, false);
- }
+ /*package*/ static void respondExc(String caller, Message response, CommandException exc, Object o) {
+ boolean quiet = quietRespondExc.contains(caller);
- /*package*/ static void respondExc(String caller, Message response, CommandException.Error err, Object o, boolean quiet) {
PrivResponseOb privResponseOb = null;
if (o instanceof PrivResponseOb) {
privResponseOb = (PrivResponseOb) o;
@@ -1065,11 +913,10 @@ public class RilOfono extends BaseCommands implements CommandsInterface {
if (!quiet) {
CharSequence debugString = toDebugString(o, privResponseOb != null);
- Rlog.d(TAG, "respondExc from "+caller+": "+err+" "+debugString);
+ Rlog.d(TAG, "respondExc from "+caller+": "+exc.getCommandError()+" "+debugString);
}
if (response != null) {
- // fill in generic exception if needed - at least GsmCallTracker
- AsyncResult.forMessage(response, o, new CommandException(err));
+ AsyncResult.forMessage(response, o, exc);
response.sendToTarget();
}
}
@@ -1139,39 +986,6 @@ public class RilOfono extends BaseCommands implements CommandsInterface {
return LOG_POTENTIALLY_SENSITIVE_INFO ? t : null;
}
- /*
- * Works similar to Android's RegistrantList.
- */
- /*package*/ interface RegistrantList {
- void notifyResult(Object result);
- }
-
- /*
- * Helps paper over the difference between a single registrant stored in a mutable field, and a list
- * of registrants.
- */
- class DynamicRegistrantListFromField implements RegistrantList {
- Field mField;
- DynamicRegistrantListFromField(String fieldname) {
- try {
- mField = Utils.getField(RilOfono.this, fieldname);
- mField.setAccessible(true);
- } catch (NoSuchFieldException e) {
- throw new RuntimeException("unable to create dynamic registrant list from field "+fieldname, e);
- }
- }
-
- @Override
- public void notifyResult(Object result) {
- try {
- Registrant registrant = (Registrant) mField.get(RilOfono.this);
- registrant.notifyResult(result);
- } catch (IllegalAccessException e) {
- throw new RuntimeException("unable to get registrant", e);
- }
- }
- }
-
private static void runWithNetworkPermittedOnMainThread(Runnable r) {
StrictMode.ThreadPolicy standardPolicy = StrictMode.getThreadPolicy();
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder(standardPolicy)
@@ -1185,6 +999,13 @@ public class RilOfono extends BaseCommands implements CommandsInterface {
}
}
+ /*
+ * Works similar to Android's RegistrantList.
+ */
+ /*package*/ interface RegistrantList {
+ void notifyResult(Object result);
+ }
+
}
// mostly a tag type to remind me use this correctly (only construct one for each purpose)
diff --git a/src/java/net/scintill/ril_ofono/RilWrapper.java b/src/java/net/scintill/ril_ofono/RilWrapper.java
new file mode 100644
index 0000000..639f78d
--- /dev/null
+++ b/src/java/net/scintill/ril_ofono/RilWrapper.java
@@ -0,0 +1,2382 @@
+/*
+ * 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 android.content.Context;
+import android.os.Registrant;
+import android.telephony.Rlog;
+
+import com.android.internal.telephony.BaseCommands;
+import com.android.internal.telephony.CommandException;
+
+import java.lang.reflect.Field;
+
+import static com.android.internal.telephony.CommandException.Error.GENERIC_FAILURE;
+import static com.android.internal.telephony.RILConstants.NO_PHONE;
+import static net.scintill.ril_ofono.RilOfono.privExc;
+import static net.scintill.ril_ofono.RilOfono.respondExc;
+import static net.scintill.ril_ofono.RilOfono.runOnDbusThread;
+
+public final class RilWrapper extends BaseCommands {
+
+ private RilInterface mRilImpl;
+ private static final String TAG = RilOfono.TAG;
+
+ private static android.os.Message sCurrentMsg;
+
+ public RilWrapper(Context ctx, int networkMode, int cdmaSubscription, Integer instanceId) {
+ super(ctx);
+ mPhoneType = NO_PHONE;
+ mRilImpl = new RilOfono(this);
+ }
+
+ /*package*/ void updateRilConnection(int version) {
+ this.mRilVersion = version;
+ if (mRilConnectedRegistrants != null) {
+ mRilConnectedRegistrants.notifyResult(version);
+ }
+ }
+
+ @Override
+ public void setPhoneType(final int a) {
+ mPhoneType = a;
+ }
+
+ @Override
+ public boolean needsOldRilFeature(final String a) {
+ return false;
+ }
+
+ /*package*/ static android.os.Message getCurrentMessage() {
+ return sCurrentMsg;
+ }
+
+ /*package*/ static final Object RETURN_LATER = new Object() {
+ @Override
+ public String toString() {
+ return "RETURN_LATER";
+ }
+ };
+
+ /*package*/ RilOfono.RegistrantList mGsmSmsRegistrants = new DynamicRegistrantListFromField("mGsmSmsRegistrant");
+ /*package*/ RilOfono.RegistrantList mUSSDRegistrants = new DynamicRegistrantListFromField("mUSSDRegistrant");
+
+ ///////////////////////////
+ // Promote some members to package visibility
+ ///////////////////////////
+
+ /*package*/ android.os.RegistrantList
+ mVoiceNetworkStateRegistrants = super.mVoiceNetworkStateRegistrants,
+ mIccStatusChangedRegistrants = super.mIccStatusChangedRegistrants,
+ mVoiceRadioTechChangedRegistrants = super.mVoiceRadioTechChangedRegistrants,
+ mCallStateRegistrants = super.mCallStateRegistrants,
+ mDataNetworkStateRegistrants = super.mDataNetworkStateRegistrants;
+
+ /*package*/ void setRadioStateHelper(RadioState newState) {
+ setRadioState(newState);
+ }
+
+ ///////////////////////////
+ // Helpers
+ ///////////////////////////
+
+ /*
+ * Helps paper over the difference between a single registrant stored in a mutable field, and a list
+ * of registrants.
+ */
+ class DynamicRegistrantListFromField implements RilOfono.RegistrantList {
+ Field mField;
+ DynamicRegistrantListFromField(String fieldname) {
+ try {
+ mField = Utils.getField(RilWrapper.this, fieldname);
+ mField.setAccessible(true);
+ } catch (NoSuchFieldException e) {
+ throw new RuntimeException("unable to create dynamic registrant list from field "+fieldname, e);
+ }
+ }
+
+ @Override
+ public void notifyResult(Object result) {
+ try {
+ Registrant registrant = (Registrant) mField.get(RilWrapper.this);
+ if (registrant != null) registrant.notifyResult(result);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException("unable to get registrant", e);
+ }
+ }
+ }
+
+ private static void respondOk(String caller, android.os.Message msg, Object ret) {
+ if (ret == RETURN_LATER) {
+ Rlog.v(TAG, caller+" will return later");
+ } else {
+ RilOfono.respondOk(caller, msg, ret);
+ }
+ }
+
+ ///////////////////////////
+ // Autogenerated wrappers
+ ///////////////////////////
+
+ public void acceptCall(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.acceptCall();
+ respondOk("acceptCall", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("acceptCall", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in acceptCall", privExc(thr));
+ respondExc("acceptCall", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void acknowledgeIncomingGsmSmsWithPdu(final boolean a, final String b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.acknowledgeIncomingGsmSmsWithPdu(a, b);
+ respondOk("acknowledgeIncomingGsmSmsWithPdu", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("acknowledgeIncomingGsmSmsWithPdu", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in acknowledgeIncomingGsmSmsWithPdu", privExc(thr));
+ respondExc("acknowledgeIncomingGsmSmsWithPdu", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void acknowledgeLastIncomingCdmaSms(final boolean a, final int b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.acknowledgeLastIncomingCdmaSms(a, b);
+ respondOk("acknowledgeLastIncomingCdmaSms", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("acknowledgeLastIncomingCdmaSms", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in acknowledgeLastIncomingCdmaSms", privExc(thr));
+ respondExc("acknowledgeLastIncomingCdmaSms", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void acknowledgeLastIncomingGsmSms(final boolean a, final int b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.acknowledgeLastIncomingGsmSms(a, b);
+ respondOk("acknowledgeLastIncomingGsmSms", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("acknowledgeLastIncomingGsmSms", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in acknowledgeLastIncomingGsmSms", privExc(thr));
+ respondExc("acknowledgeLastIncomingGsmSms", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void cancelPendingUssd(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.cancelPendingUssd();
+ respondOk("cancelPendingUssd", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("cancelPendingUssd", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in cancelPendingUssd", privExc(thr));
+ respondExc("cancelPendingUssd", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void changeBarringPassword(final String a, final String b, final String c, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.changeBarringPassword(a, b, c);
+ respondOk("changeBarringPassword", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("changeBarringPassword", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in changeBarringPassword", privExc(thr));
+ respondExc("changeBarringPassword", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void changeIccPin(final String a, final String b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.changeIccPin(a, b);
+ respondOk("changeIccPin", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("changeIccPin", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in changeIccPin", privExc(thr));
+ respondExc("changeIccPin", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void changeIccPin2(final String a, final String b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.changeIccPin2(a, b);
+ respondOk("changeIccPin2", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("changeIccPin2", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in changeIccPin2", privExc(thr));
+ respondExc("changeIccPin2", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void changeIccPin2ForApp(final String a, final String b, final String c, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.changeIccPin2ForApp(a, b, c);
+ respondOk("changeIccPin2ForApp", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("changeIccPin2ForApp", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in changeIccPin2ForApp", privExc(thr));
+ respondExc("changeIccPin2ForApp", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void changeIccPinForApp(final String a, final String b, final String c, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.changeIccPinForApp(a, b, c);
+ respondOk("changeIccPinForApp", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("changeIccPinForApp", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in changeIccPinForApp", privExc(thr));
+ respondExc("changeIccPinForApp", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void conference(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.conference();
+ respondOk("conference", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("conference", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in conference", privExc(thr));
+ respondExc("conference", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void deactivateDataCall(final int a, final int b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.deactivateDataCall(a, b);
+ respondOk("deactivateDataCall", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("deactivateDataCall", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in deactivateDataCall", privExc(thr));
+ respondExc("deactivateDataCall", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void deleteSmsOnRuim(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.deleteSmsOnRuim(a);
+ respondOk("deleteSmsOnRuim", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("deleteSmsOnRuim", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in deleteSmsOnRuim", privExc(thr));
+ respondExc("deleteSmsOnRuim", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void deleteSmsOnSim(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.deleteSmsOnSim(a);
+ respondOk("deleteSmsOnSim", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("deleteSmsOnSim", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in deleteSmsOnSim", privExc(thr));
+ respondExc("deleteSmsOnSim", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void dial(final String a, final int b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.dial(a, b);
+ respondOk("dial", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("dial", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in dial", privExc(thr));
+ respondExc("dial", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void dial(final String a, final int b, final com.android.internal.telephony.UUSInfo c, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.dial(a, b, c);
+ respondOk("dial", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("dial", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in dial", privExc(thr));
+ respondExc("dial", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void exitEmergencyCallbackMode(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.exitEmergencyCallbackMode();
+ respondOk("exitEmergencyCallbackMode", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("exitEmergencyCallbackMode", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in exitEmergencyCallbackMode", privExc(thr));
+ respondExc("exitEmergencyCallbackMode", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void explicitCallTransfer(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.explicitCallTransfer();
+ respondOk("explicitCallTransfer", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("explicitCallTransfer", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in explicitCallTransfer", privExc(thr));
+ respondExc("explicitCallTransfer", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getAvailableNetworks(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getAvailableNetworks();
+ respondOk("getAvailableNetworks", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getAvailableNetworks", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getAvailableNetworks", privExc(thr));
+ respondExc("getAvailableNetworks", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getBasebandVersion(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getBasebandVersion();
+ respondOk("getBasebandVersion", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getBasebandVersion", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getBasebandVersion", privExc(thr));
+ respondExc("getBasebandVersion", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getCDMASubscription(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getCDMASubscription();
+ respondOk("getCDMASubscription", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getCDMASubscription", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getCDMASubscription", privExc(thr));
+ respondExc("getCDMASubscription", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getCLIR(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getCLIR();
+ respondOk("getCLIR", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getCLIR", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getCLIR", privExc(thr));
+ respondExc("getCLIR", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getCdmaBroadcastConfig(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getCdmaBroadcastConfig();
+ respondOk("getCdmaBroadcastConfig", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getCdmaBroadcastConfig", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getCdmaBroadcastConfig", privExc(thr));
+ respondExc("getCdmaBroadcastConfig", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getCdmaSubscriptionSource(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getCdmaSubscriptionSource();
+ respondOk("getCdmaSubscriptionSource", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getCdmaSubscriptionSource", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getCdmaSubscriptionSource", privExc(thr));
+ respondExc("getCdmaSubscriptionSource", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getCellInfoList(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getCellInfoList();
+ respondOk("getCellInfoList", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getCellInfoList", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getCellInfoList", privExc(thr));
+ respondExc("getCellInfoList", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getCurrentCalls(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getCurrentCalls();
+ respondOk("getCurrentCalls", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getCurrentCalls", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getCurrentCalls", privExc(thr));
+ respondExc("getCurrentCalls", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getDataCallList(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getDataCallList();
+ respondOk("getDataCallList", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getDataCallList", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getDataCallList", privExc(thr));
+ respondExc("getDataCallList", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getDataCallProfile(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getDataCallProfile(a);
+ respondOk("getDataCallProfile", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getDataCallProfile", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getDataCallProfile", privExc(thr));
+ respondExc("getDataCallProfile", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getDataRegistrationState(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getDataRegistrationState();
+ respondOk("getDataRegistrationState", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getDataRegistrationState", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getDataRegistrationState", privExc(thr));
+ respondExc("getDataRegistrationState", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getDeviceIdentity(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getDeviceIdentity();
+ respondOk("getDeviceIdentity", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getDeviceIdentity", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getDeviceIdentity", privExc(thr));
+ respondExc("getDeviceIdentity", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getGsmBroadcastConfig(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getGsmBroadcastConfig();
+ respondOk("getGsmBroadcastConfig", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getGsmBroadcastConfig", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getGsmBroadcastConfig", privExc(thr));
+ respondExc("getGsmBroadcastConfig", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getHardwareConfig(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getHardwareConfig();
+ respondOk("getHardwareConfig", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getHardwareConfig", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getHardwareConfig", privExc(thr));
+ respondExc("getHardwareConfig", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getIMEI(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getIMEI();
+ respondOk("getIMEI", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getIMEI", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getIMEI", privExc(thr));
+ respondExc("getIMEI", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getIMEISV(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getIMEISV();
+ respondOk("getIMEISV", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getIMEISV", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getIMEISV", privExc(thr));
+ respondExc("getIMEISV", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getIMSI(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getIMSI();
+ respondOk("getIMSI", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getIMSI", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getIMSI", privExc(thr));
+ respondExc("getIMSI", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getIMSIForApp(final String a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getIMSIForApp(a);
+ respondOk("getIMSIForApp", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getIMSIForApp", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getIMSIForApp", privExc(thr));
+ respondExc("getIMSIForApp", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getIccCardStatus(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getIccCardStatus();
+ respondOk("getIccCardStatus", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getIccCardStatus", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getIccCardStatus", privExc(thr));
+ respondExc("getIccCardStatus", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getImsRegistrationState(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getImsRegistrationState();
+ respondOk("getImsRegistrationState", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getImsRegistrationState", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getImsRegistrationState", privExc(thr));
+ respondExc("getImsRegistrationState", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getLastCallFailCause(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getLastCallFailCause();
+ respondOk("getLastCallFailCause", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getLastCallFailCause", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getLastCallFailCause", privExc(thr));
+ respondExc("getLastCallFailCause", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getLastDataCallFailCause(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getLastDataCallFailCause();
+ respondOk("getLastDataCallFailCause", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getLastDataCallFailCause", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getLastDataCallFailCause", privExc(thr));
+ respondExc("getLastDataCallFailCause", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getLastPdpFailCause(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getLastPdpFailCause();
+ respondOk("getLastPdpFailCause", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getLastPdpFailCause", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getLastPdpFailCause", privExc(thr));
+ respondExc("getLastPdpFailCause", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getMute(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getMute();
+ respondOk("getMute", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getMute", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getMute", privExc(thr));
+ respondExc("getMute", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getNeighboringCids(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getNeighboringCids();
+ respondOk("getNeighboringCids", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getNeighboringCids", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getNeighboringCids", privExc(thr));
+ respondExc("getNeighboringCids", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getNetworkSelectionMode(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getNetworkSelectionMode();
+ respondOk("getNetworkSelectionMode", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getNetworkSelectionMode", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getNetworkSelectionMode", privExc(thr));
+ respondExc("getNetworkSelectionMode", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getOperator(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getOperator();
+ respondOk("getOperator", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getOperator", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getOperator", privExc(thr));
+ respondExc("getOperator", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getPDPContextList(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getPDPContextList();
+ respondOk("getPDPContextList", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getPDPContextList", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getPDPContextList", privExc(thr));
+ respondExc("getPDPContextList", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getPreferredNetworkType(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getPreferredNetworkType();
+ respondOk("getPreferredNetworkType", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getPreferredNetworkType", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getPreferredNetworkType", privExc(thr));
+ respondExc("getPreferredNetworkType", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getPreferredVoicePrivacy(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getPreferredVoicePrivacy();
+ respondOk("getPreferredVoicePrivacy", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getPreferredVoicePrivacy", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getPreferredVoicePrivacy", privExc(thr));
+ respondExc("getPreferredVoicePrivacy", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getSignalStrength(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getSignalStrength();
+ respondOk("getSignalStrength", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getSignalStrength", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getSignalStrength", privExc(thr));
+ respondExc("getSignalStrength", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getSmscAddress(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getSmscAddress();
+ respondOk("getSmscAddress", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getSmscAddress", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getSmscAddress", privExc(thr));
+ respondExc("getSmscAddress", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getVoiceRadioTechnology(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getVoiceRadioTechnology();
+ respondOk("getVoiceRadioTechnology", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getVoiceRadioTechnology", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getVoiceRadioTechnology", privExc(thr));
+ respondExc("getVoiceRadioTechnology", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void getVoiceRegistrationState(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.getVoiceRegistrationState();
+ respondOk("getVoiceRegistrationState", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("getVoiceRegistrationState", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in getVoiceRegistrationState", privExc(thr));
+ respondExc("getVoiceRegistrationState", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void handleCallSetupRequestFromSim(final boolean a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.handleCallSetupRequestFromSim(a);
+ respondOk("handleCallSetupRequestFromSim", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("handleCallSetupRequestFromSim", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in handleCallSetupRequestFromSim", privExc(thr));
+ respondExc("handleCallSetupRequestFromSim", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void hangupConnection(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.hangupConnection(a);
+ respondOk("hangupConnection", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("hangupConnection", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in hangupConnection", privExc(thr));
+ respondExc("hangupConnection", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void hangupForegroundResumeBackground(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.hangupForegroundResumeBackground();
+ respondOk("hangupForegroundResumeBackground", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("hangupForegroundResumeBackground", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in hangupForegroundResumeBackground", privExc(thr));
+ respondExc("hangupForegroundResumeBackground", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void hangupWaitingOrBackground(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.hangupWaitingOrBackground();
+ respondOk("hangupWaitingOrBackground", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("hangupWaitingOrBackground", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in hangupWaitingOrBackground", privExc(thr));
+ respondExc("hangupWaitingOrBackground", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void iccIO(final int a, final int b, final String c, final int d, final int e, final int f, final String g, final String h, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.iccIO(a, b, c, d, e, f, g, h);
+ respondOk("iccIO", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("iccIO", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in iccIO", privExc(thr));
+ respondExc("iccIO", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void iccIOForApp(final int a, final int b, final String c, final int d, final int e, final int f, final String g, final String h, final String i, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.iccIOForApp(a, b, c, d, e, f, g, h, i);
+ respondOk("iccIOForApp", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("iccIOForApp", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in iccIOForApp", privExc(thr));
+ respondExc("iccIOForApp", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void invokeOemRilRequestRaw(final byte[] a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.invokeOemRilRequestRaw(a);
+ respondOk("invokeOemRilRequestRaw", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("invokeOemRilRequestRaw", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in invokeOemRilRequestRaw", privExc(thr));
+ respondExc("invokeOemRilRequestRaw", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void invokeOemRilRequestStrings(final String[] a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.invokeOemRilRequestStrings(a);
+ respondOk("invokeOemRilRequestStrings", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("invokeOemRilRequestStrings", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in invokeOemRilRequestStrings", privExc(thr));
+ respondExc("invokeOemRilRequestStrings", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void nvReadItem(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.nvReadItem(a);
+ respondOk("nvReadItem", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("nvReadItem", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in nvReadItem", privExc(thr));
+ respondExc("nvReadItem", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void nvResetConfig(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.nvResetConfig(a);
+ respondOk("nvResetConfig", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("nvResetConfig", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in nvResetConfig", privExc(thr));
+ respondExc("nvResetConfig", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void nvWriteCdmaPrl(final byte[] a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.nvWriteCdmaPrl(a);
+ respondOk("nvWriteCdmaPrl", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("nvWriteCdmaPrl", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in nvWriteCdmaPrl", privExc(thr));
+ respondExc("nvWriteCdmaPrl", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void nvWriteItem(final int a, final String b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.nvWriteItem(a, b);
+ respondOk("nvWriteItem", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("nvWriteItem", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in nvWriteItem", privExc(thr));
+ respondExc("nvWriteItem", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void queryAvailableBandMode(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.queryAvailableBandMode();
+ respondOk("queryAvailableBandMode", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("queryAvailableBandMode", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in queryAvailableBandMode", privExc(thr));
+ respondExc("queryAvailableBandMode", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void queryCLIP(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.queryCLIP();
+ respondOk("queryCLIP", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("queryCLIP", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in queryCLIP", privExc(thr));
+ respondExc("queryCLIP", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void queryCallForwardStatus(final int a, final int b, final String c, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.queryCallForwardStatus(a, b, c);
+ respondOk("queryCallForwardStatus", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("queryCallForwardStatus", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in queryCallForwardStatus", privExc(thr));
+ respondExc("queryCallForwardStatus", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void queryCallWaiting(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.queryCallWaiting(a);
+ respondOk("queryCallWaiting", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("queryCallWaiting", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in queryCallWaiting", privExc(thr));
+ respondExc("queryCallWaiting", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void queryCdmaRoamingPreference(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.queryCdmaRoamingPreference();
+ respondOk("queryCdmaRoamingPreference", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("queryCdmaRoamingPreference", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in queryCdmaRoamingPreference", privExc(thr));
+ respondExc("queryCdmaRoamingPreference", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void queryFacilityLock(final String a, final String b, final int c, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.queryFacilityLock(a, b, c);
+ respondOk("queryFacilityLock", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("queryFacilityLock", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in queryFacilityLock", privExc(thr));
+ respondExc("queryFacilityLock", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void queryFacilityLockForApp(final String a, final String b, final int c, final String d, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.queryFacilityLockForApp(a, b, c, d);
+ respondOk("queryFacilityLockForApp", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("queryFacilityLockForApp", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in queryFacilityLockForApp", privExc(thr));
+ respondExc("queryFacilityLockForApp", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void queryTTYMode(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.queryTTYMode();
+ respondOk("queryTTYMode", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("queryTTYMode", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in queryTTYMode", privExc(thr));
+ respondExc("queryTTYMode", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void rejectCall(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.rejectCall();
+ respondOk("rejectCall", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("rejectCall", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in rejectCall", privExc(thr));
+ respondExc("rejectCall", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void reportSmsMemoryStatus(final boolean a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.reportSmsMemoryStatus(a);
+ respondOk("reportSmsMemoryStatus", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("reportSmsMemoryStatus", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in reportSmsMemoryStatus", privExc(thr));
+ respondExc("reportSmsMemoryStatus", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void reportStkServiceIsRunning(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.reportStkServiceIsRunning();
+ respondOk("reportStkServiceIsRunning", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("reportStkServiceIsRunning", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in reportStkServiceIsRunning", privExc(thr));
+ respondExc("reportStkServiceIsRunning", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void requestIccSimAuthentication(final int a, final String b, final String c, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.requestIccSimAuthentication(a, b, c);
+ respondOk("requestIccSimAuthentication", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("requestIccSimAuthentication", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in requestIccSimAuthentication", privExc(thr));
+ respondExc("requestIccSimAuthentication", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void requestIsimAuthentication(final String a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.requestIsimAuthentication(a);
+ respondOk("requestIsimAuthentication", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("requestIsimAuthentication", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in requestIsimAuthentication", privExc(thr));
+ respondExc("requestIsimAuthentication", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void resetRadio(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.resetRadio();
+ respondOk("resetRadio", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("resetRadio", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in resetRadio", privExc(thr));
+ respondExc("resetRadio", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void sendBurstDtmf(final String a, final int b, final int c, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.sendBurstDtmf(a, b, c);
+ respondOk("sendBurstDtmf", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("sendBurstDtmf", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in sendBurstDtmf", privExc(thr));
+ respondExc("sendBurstDtmf", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void sendCDMAFeatureCode(final String a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.sendCDMAFeatureCode(a);
+ respondOk("sendCDMAFeatureCode", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("sendCDMAFeatureCode", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in sendCDMAFeatureCode", privExc(thr));
+ respondExc("sendCDMAFeatureCode", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void sendCdmaSms(final byte[] a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.sendCdmaSms(a);
+ respondOk("sendCdmaSms", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("sendCdmaSms", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in sendCdmaSms", privExc(thr));
+ respondExc("sendCdmaSms", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void sendDtmf(final char a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.sendDtmf(a);
+ respondOk("sendDtmf", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("sendDtmf", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in sendDtmf", privExc(thr));
+ respondExc("sendDtmf", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void sendEnvelope(final String a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.sendEnvelope(a);
+ respondOk("sendEnvelope", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("sendEnvelope", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in sendEnvelope", privExc(thr));
+ respondExc("sendEnvelope", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void sendEnvelopeWithStatus(final String a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.sendEnvelopeWithStatus(a);
+ respondOk("sendEnvelopeWithStatus", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("sendEnvelopeWithStatus", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in sendEnvelopeWithStatus", privExc(thr));
+ respondExc("sendEnvelopeWithStatus", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void sendImsCdmaSms(final byte[] a, final int b, final int c, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.sendImsCdmaSms(a, b, c);
+ respondOk("sendImsCdmaSms", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("sendImsCdmaSms", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in sendImsCdmaSms", privExc(thr));
+ respondExc("sendImsCdmaSms", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void sendImsGsmSms(final String a, final String b, final int c, final int d, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.sendImsGsmSms(a, b, c, d);
+ respondOk("sendImsGsmSms", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("sendImsGsmSms", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in sendImsGsmSms", privExc(thr));
+ respondExc("sendImsGsmSms", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void sendSMS(final String a, final String b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.sendSMS(a, b);
+ respondOk("sendSMS", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("sendSMS", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in sendSMS", privExc(thr));
+ respondExc("sendSMS", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void sendSMSExpectMore(final String a, final String b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.sendSMSExpectMore(a, b);
+ respondOk("sendSMSExpectMore", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("sendSMSExpectMore", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in sendSMSExpectMore", privExc(thr));
+ respondExc("sendSMSExpectMore", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void sendTerminalResponse(final String a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.sendTerminalResponse(a);
+ respondOk("sendTerminalResponse", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("sendTerminalResponse", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in sendTerminalResponse", privExc(thr));
+ respondExc("sendTerminalResponse", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void sendUSSD(final String a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.sendUSSD(a);
+ respondOk("sendUSSD", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("sendUSSD", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in sendUSSD", privExc(thr));
+ respondExc("sendUSSD", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void separateConnection(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.separateConnection(a);
+ respondOk("separateConnection", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("separateConnection", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in separateConnection", privExc(thr));
+ respondExc("separateConnection", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setBandMode(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setBandMode(a);
+ respondOk("setBandMode", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setBandMode", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setBandMode", privExc(thr));
+ respondExc("setBandMode", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setCLIR(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setCLIR(a);
+ respondOk("setCLIR", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setCLIR", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setCLIR", privExc(thr));
+ respondExc("setCLIR", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setCallForward(final int a, final int b, final int c, final String d, final int e, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setCallForward(a, b, c, d, e);
+ respondOk("setCallForward", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setCallForward", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setCallForward", privExc(thr));
+ respondExc("setCallForward", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setCallWaiting(final boolean a, final int b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setCallWaiting(a, b);
+ respondOk("setCallWaiting", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setCallWaiting", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setCallWaiting", privExc(thr));
+ respondExc("setCallWaiting", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setCdmaBroadcastActivation(final boolean a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setCdmaBroadcastActivation(a);
+ respondOk("setCdmaBroadcastActivation", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setCdmaBroadcastActivation", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setCdmaBroadcastActivation", privExc(thr));
+ respondExc("setCdmaBroadcastActivation", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setCdmaBroadcastConfig(final com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo[] a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setCdmaBroadcastConfig(a);
+ respondOk("setCdmaBroadcastConfig", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setCdmaBroadcastConfig", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setCdmaBroadcastConfig", privExc(thr));
+ respondExc("setCdmaBroadcastConfig", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setCdmaRoamingPreference(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setCdmaRoamingPreference(a);
+ respondOk("setCdmaRoamingPreference", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setCdmaRoamingPreference", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setCdmaRoamingPreference", privExc(thr));
+ respondExc("setCdmaRoamingPreference", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setCdmaSubscriptionSource(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setCdmaSubscriptionSource(a);
+ respondOk("setCdmaSubscriptionSource", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setCdmaSubscriptionSource", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setCdmaSubscriptionSource", privExc(thr));
+ respondExc("setCdmaSubscriptionSource", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setCellInfoListRate(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setCellInfoListRate(a);
+ respondOk("setCellInfoListRate", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setCellInfoListRate", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setCellInfoListRate", privExc(thr));
+ respondExc("setCellInfoListRate", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setDataAllowed(final boolean a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setDataAllowed(a);
+ respondOk("setDataAllowed", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setDataAllowed", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setDataAllowed", privExc(thr));
+ respondExc("setDataAllowed", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setDataProfile(final com.android.internal.telephony.dataconnection.DataProfile[] a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setDataProfile(a);
+ respondOk("setDataProfile", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setDataProfile", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setDataProfile", privExc(thr));
+ respondExc("setDataProfile", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setFacilityLock(final String a, final boolean b, final String c, final int d, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setFacilityLock(a, b, c, d);
+ respondOk("setFacilityLock", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setFacilityLock", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setFacilityLock", privExc(thr));
+ respondExc("setFacilityLock", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setFacilityLockForApp(final String a, final boolean b, final String c, final int d, final String e, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setFacilityLockForApp(a, b, c, d, e);
+ respondOk("setFacilityLockForApp", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setFacilityLockForApp", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setFacilityLockForApp", privExc(thr));
+ respondExc("setFacilityLockForApp", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setGsmBroadcastActivation(final boolean a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setGsmBroadcastActivation(a);
+ respondOk("setGsmBroadcastActivation", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setGsmBroadcastActivation", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setGsmBroadcastActivation", privExc(thr));
+ respondExc("setGsmBroadcastActivation", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setGsmBroadcastConfig(final com.android.internal.telephony.gsm.SmsBroadcastConfigInfo[] a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setGsmBroadcastConfig(a);
+ respondOk("setGsmBroadcastConfig", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setGsmBroadcastConfig", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setGsmBroadcastConfig", privExc(thr));
+ respondExc("setGsmBroadcastConfig", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setInitialAttachApn(final String a, final String b, final int c, final String d, final String e, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setInitialAttachApn(a, b, c, d, e);
+ respondOk("setInitialAttachApn", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setInitialAttachApn", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setInitialAttachApn", privExc(thr));
+ respondExc("setInitialAttachApn", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setLocationUpdates(final boolean a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setLocationUpdates(a);
+ respondOk("setLocationUpdates", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setLocationUpdates", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setLocationUpdates", privExc(thr));
+ respondExc("setLocationUpdates", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setMute(final boolean a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setMute(a);
+ respondOk("setMute", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setMute", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setMute", privExc(thr));
+ respondExc("setMute", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setNetworkSelectionModeAutomatic(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setNetworkSelectionModeAutomatic();
+ respondOk("setNetworkSelectionModeAutomatic", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setNetworkSelectionModeAutomatic", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setNetworkSelectionModeAutomatic", privExc(thr));
+ respondExc("setNetworkSelectionModeAutomatic", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setNetworkSelectionModeManual(final String a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setNetworkSelectionModeManual(a);
+ respondOk("setNetworkSelectionModeManual", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setNetworkSelectionModeManual", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setNetworkSelectionModeManual", privExc(thr));
+ respondExc("setNetworkSelectionModeManual", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setPreferredNetworkType(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setPreferredNetworkType(a);
+ respondOk("setPreferredNetworkType", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setPreferredNetworkType", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setPreferredNetworkType", privExc(thr));
+ respondExc("setPreferredNetworkType", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setPreferredVoicePrivacy(final boolean a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setPreferredVoicePrivacy(a);
+ respondOk("setPreferredVoicePrivacy", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setPreferredVoicePrivacy", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setPreferredVoicePrivacy", privExc(thr));
+ respondExc("setPreferredVoicePrivacy", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setRadioPower(final boolean a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setRadioPower(a);
+ respondOk("setRadioPower", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setRadioPower", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setRadioPower", privExc(thr));
+ respondExc("setRadioPower", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setSmscAddress(final String a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setSmscAddress(a);
+ respondOk("setSmscAddress", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setSmscAddress", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setSmscAddress", privExc(thr));
+ respondExc("setSmscAddress", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setSuppServiceNotifications(final boolean a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setSuppServiceNotifications(a);
+ respondOk("setSuppServiceNotifications", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setSuppServiceNotifications", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setSuppServiceNotifications", privExc(thr));
+ respondExc("setSuppServiceNotifications", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setTTYMode(final int a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setTTYMode(a);
+ respondOk("setTTYMode", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setTTYMode", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setTTYMode", privExc(thr));
+ respondExc("setTTYMode", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void setupDataCall(final String a, final String b, final String c, final String d, final String e, final String f, final String g, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.setupDataCall(a, b, c, d, e, f, g);
+ respondOk("setupDataCall", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("setupDataCall", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in setupDataCall", privExc(thr));
+ respondExc("setupDataCall", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void startDtmf(final char a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.startDtmf(a);
+ respondOk("startDtmf", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("startDtmf", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in startDtmf", privExc(thr));
+ respondExc("startDtmf", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void stopDtmf(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.stopDtmf();
+ respondOk("stopDtmf", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("stopDtmf", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in stopDtmf", privExc(thr));
+ respondExc("stopDtmf", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void supplyDepersonalization(final String a, final String b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.supplyDepersonalization(a, b);
+ respondOk("supplyDepersonalization", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("supplyDepersonalization", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in supplyDepersonalization", privExc(thr));
+ respondExc("supplyDepersonalization", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void supplyIccPin(final String a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.supplyIccPin(a);
+ respondOk("supplyIccPin", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("supplyIccPin", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in supplyIccPin", privExc(thr));
+ respondExc("supplyIccPin", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void supplyIccPin2(final String a, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.supplyIccPin2(a);
+ respondOk("supplyIccPin2", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("supplyIccPin2", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in supplyIccPin2", privExc(thr));
+ respondExc("supplyIccPin2", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void supplyIccPin2ForApp(final String a, final String b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.supplyIccPin2ForApp(a, b);
+ respondOk("supplyIccPin2ForApp", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("supplyIccPin2ForApp", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in supplyIccPin2ForApp", privExc(thr));
+ respondExc("supplyIccPin2ForApp", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void supplyIccPinForApp(final String a, final String b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.supplyIccPinForApp(a, b);
+ respondOk("supplyIccPinForApp", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("supplyIccPinForApp", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in supplyIccPinForApp", privExc(thr));
+ respondExc("supplyIccPinForApp", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void supplyIccPuk(final String a, final String b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.supplyIccPuk(a, b);
+ respondOk("supplyIccPuk", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("supplyIccPuk", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in supplyIccPuk", privExc(thr));
+ respondExc("supplyIccPuk", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void supplyIccPuk2(final String a, final String b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.supplyIccPuk2(a, b);
+ respondOk("supplyIccPuk2", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("supplyIccPuk2", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in supplyIccPuk2", privExc(thr));
+ respondExc("supplyIccPuk2", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void supplyIccPuk2ForApp(final String a, final String b, final String c, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.supplyIccPuk2ForApp(a, b, c);
+ respondOk("supplyIccPuk2ForApp", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("supplyIccPuk2ForApp", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in supplyIccPuk2ForApp", privExc(thr));
+ respondExc("supplyIccPuk2ForApp", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void supplyIccPukForApp(final String a, final String b, final String c, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.supplyIccPukForApp(a, b, c);
+ respondOk("supplyIccPukForApp", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("supplyIccPukForApp", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in supplyIccPukForApp", privExc(thr));
+ respondExc("supplyIccPukForApp", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void switchWaitingOrHoldingAndActive(final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.switchWaitingOrHoldingAndActive();
+ respondOk("switchWaitingOrHoldingAndActive", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("switchWaitingOrHoldingAndActive", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in switchWaitingOrHoldingAndActive", privExc(thr));
+ respondExc("switchWaitingOrHoldingAndActive", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void writeSmsToRuim(final int a, final String b, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.writeSmsToRuim(a, b);
+ respondOk("writeSmsToRuim", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("writeSmsToRuim", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in writeSmsToRuim", privExc(thr));
+ respondExc("writeSmsToRuim", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+ public void writeSmsToSim(final int a, final String b, final String c, final android.os.Message msg) {
+ runOnDbusThread(new Runnable() {
+ public void run() {
+ sCurrentMsg = msg;
+ try {
+ Object ret = mRilImpl.writeSmsToSim(a, b, c);
+ respondOk("writeSmsToSim", msg, ret);
+ } catch (CommandException exc) {
+ respondExc("writeSmsToSim", msg, exc, null);
+ } catch (Throwable thr) {
+ Rlog.e(TAG, "Uncaught exception in writeSmsToSim", privExc(thr));
+ respondExc("writeSmsToSim", msg, new CommandException(GENERIC_FAILURE), null);
+ }
+ }
+ });
+ }
+
+}
diff --git a/src/java/net/scintill/ril_ofono/SimFiles.java b/src/java/net/scintill/ril_ofono/SimFiles.java
index 9ec1833..32a0118 100644
--- a/src/java/net/scintill/ril_ofono/SimFiles.java
+++ b/src/java/net/scintill/ril_ofono/SimFiles.java
@@ -23,6 +23,7 @@ package net.scintill.ril_ofono;
import android.os.Message;
import android.text.TextUtils;
+import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.uicc.AdnRecord;
import com.android.internal.telephony.uicc.IccConstants;
import com.android.internal.telephony.uicc.IccIoResult;
@@ -58,28 +59,28 @@ import static net.scintill.ril_ofono.PropManager.getProp;
// TODO notify of refreshes of the SIM files based on props changing. mIccRefreshRegistrants take file IDs
- public void iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, String aid, Message response) {
+ public Object iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, String aid) {
// TS 102 221
- String humanPath = path + "/" + Integer.toHexString(fileid);
+ //String humanPath = path + "/" + Integer.toHexString(fileid);
//Rlog.d(TAG, "iccIO " + command + " " + humanPath + " " + RilOfono.privStr(p1) + " " + RilOfono.privStr(p2) + " " + RilOfono.privStr(p3) + " " + RilOfono.privStr(data) + " " + RilOfono.privStr(pin2) + " " + aid);
SimFile file = getSimFile(path, fileid);
if (file == null) {
- RilOfono.respondOk("iccIOForApp " + humanPath, response, new IccIoResult(0x94, 0x00, new byte[0]), true);
+ return new IccIoResult(0x94, 0x00, new byte[0]);
} else {
if (command == COMMAND_GET_RESPONSE) {
- RilOfono.respondOk("iccIOForApp GetResponse " + humanPath, response, new PrivResponseOb(new IccIoResult(0x90, 0x00, file.getResponse())), true);
+ return new PrivResponseOb(new IccIoResult(0x90, 0x00, file.getResponse()));
} else if (command == COMMAND_READ_BINARY) {
int offset = p1 << 8 + p2;
int length = p3 & 0xff;
byte[] filePiece = new byte[length];
System.arraycopy(file.mData, offset, filePiece, 0, length);
- RilOfono.respondOk("iccIOForApp ReadBinary " + humanPath, response, new PrivResponseOb(new IccIoResult(0x90, 0x00, filePiece)), true);
+ return new PrivResponseOb(new IccIoResult(0x90, 0x00, filePiece));
} else if (command == COMMAND_READ_RECORD) {
// XXX ignoring some semantics of READ_RECORD...
- RilOfono.respondOk("iccIOForApp ReadRecord " + humanPath, response, new PrivResponseOb(new IccIoResult(0x90, 0x00, file.mData)), true);
+ return new PrivResponseOb(new IccIoResult(0x90, 0x00, file.mData));
} else {
- RilOfono.respondExc("iccIOForApp " + command + " " + humanPath, response, REQUEST_NOT_SUPPORTED, null, true);
+ throw new CommandException(REQUEST_NOT_SUPPORTED);
}
}
}
diff --git a/src/java/net/scintill/ril_ofono/SimModule.java b/src/java/net/scintill/ril_ofono/SimModule.java
index 1190564..6c5f061 100644
--- a/src/java/net/scintill/ril_ofono/SimModule.java
+++ b/src/java/net/scintill/ril_ofono/SimModule.java
@@ -19,10 +19,10 @@
package net.scintill.ril_ofono;
-import android.os.Message;
import android.os.RegistrantList;
import android.telephony.Rlog;
+import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.uicc.IccCardApplicationStatus;
import com.android.internal.telephony.uicc.IccCardStatus;
import com.android.internal.telephony.uicc.IccCardStatus.CardState;
@@ -35,8 +35,6 @@ import java.util.HashMap;
import java.util.Map;
import static com.android.internal.telephony.CommandException.Error.GENERIC_FAILURE;
-import static net.scintill.ril_ofono.RilOfono.respondExc;
-import static net.scintill.ril_ofono.RilOfono.respondOk;
import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
/*package*/ class SimModule extends PropManager {
@@ -65,23 +63,23 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
@RilMethod
- public void iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, String aid, Message response) {
- mSimFiles.iccIOForApp(command, fileid, path, p1, p2, p3, data, pin2, aid, response);
+ public Object iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, String aid) {
+ return mSimFiles.iccIOForApp(command, fileid, path, p1, p2, p3, data, pin2, aid);
}
@RilMethod
- public void getIMSIForApp(String aid, Message result) {
+ public Object getIMSIForApp(String aid) {
// TODO GSM-specific?
String imsi = getProp(mSimProps, "SubscriberIdentity", (String)null);
if (imsi != null) {
- respondOk("getIMSIForApp", result, new PrivResponseOb(imsi), true);
+ return new PrivResponseOb(imsi);
} else {
- respondExc("getIMSIForApp", result, GENERIC_FAILURE, null);
+ throw new CommandException(GENERIC_FAILURE);
}
}
@RilMethod
- public void getIccCardStatus(Message result) {
+ public Object getIccCardStatus() {
// TODO GSM-specific? can we/should we do more?
IccCardStatus cardStatus = new IccCardStatus();
cardStatus.mCdmaSubscriptionAppIndex = -1;
@@ -112,7 +110,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
cardStatus.mUniversalPinState = IccCardStatus.PinState.PINSTATE_DISABLED; // TODO
- respondOk("getIccCardStatus", result, new PrivResponseOb(cardStatus), true);
+ return new PrivResponseOb(cardStatus);
}
protected void onPropChange(SimManager simManager, String name, Variant value) {
diff --git a/src/java/net/scintill/ril_ofono/SmsModule.java b/src/java/net/scintill/ril_ofono/SmsModule.java
index 6992de4..692590a 100644
--- a/src/java/net/scintill/ril_ofono/SmsModule.java
+++ b/src/java/net/scintill/ril_ofono/SmsModule.java
@@ -23,6 +23,7 @@ import android.os.Message;
import android.telephony.Rlog;
import android.telephony.SmsMessage;
+import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.IccUtils;
import com.android.internal.telephony.SmsConstants;
import com.android.internal.telephony.SmsResponse;
@@ -38,7 +39,6 @@ import static com.android.internal.telephony.CommandException.Error.GENERIC_FAIL
import static net.scintill.ril_ofono.RilOfono.privStr;
import static net.scintill.ril_ofono.RilOfono.respondExc;
import static net.scintill.ril_ofono.RilOfono.respondOk;
-import static net.scintill.ril_ofono.RilOfono.runOnDbusThread;
import static net.scintill.ril_ofono.RilOfono.runOnMainThread;
/*package*/ class SmsModule {
@@ -62,7 +62,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThread;
}
@RilMethod
- public void sendSMS(String smscPDUStr, String pduStr, final Message response) {
+ public Object sendSMS(String smscPDUStr, String pduStr) {
Rlog.d(TAG, "sendSMS");
// TODO gsm-specific?
if (smscPDUStr == null) smscPDUStr = "00";
@@ -70,23 +70,13 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThread;
final byte[] smscPDU = IccUtils.hexStringToBytes(smscPDUStr);
final byte[] pdu = IccUtils.hexStringToBytes(pduStr);
- runOnDbusThread(new Runnable() {
- @Override
- public void run() {
- try {
- synchronized (mMapSmsDbusPathToSenderCallback) {
- // TODO timeout on this method? at least we're not on the main thread,
- // but we could block anything else trying to get on the dbus thread
- Path sentMessage = mMessenger.SendPdu(smscPDU, pdu);
- mMapSmsDbusPathToSenderCallback.put(sentMessage.getPath(), response);
- }
- } catch (Throwable t) {
- // TODO catch format errors that oFono found and return a better error code?
- Rlog.e(TAG, "Error sending msg", t);
- respondExc("sendSMS", response, GENERIC_FAILURE, null);
- }
- }
- });
+ synchronized (mMapSmsDbusPathToSenderCallback) {
+ // TODO timeout on this method? at least we're not on the main thread,
+ // but we could block anything else trying to get on the dbus thread
+ Path sentMessage = mMessenger.SendPdu(smscPDU, pdu);
+ mMapSmsDbusPathToSenderCallback.put(sentMessage.getPath(), RilWrapper.getCurrentMessage());
+ }
+ return RilWrapper.RETURN_LATER;
}
public void handleSendSmsComplete(String msgDbusPath, String status) {
@@ -104,7 +94,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThread;
if (success) {
respondOk("sendSMS", senderCb, new SmsResponse(mSmsRef.incrementAndGet(), ackPdu, -1));
} else {
- respondExc("sendSMS", senderCb, GENERIC_FAILURE, new SmsResponse(mSmsRef.incrementAndGet(), ackPdu, -1));
+ respondExc("sendSMS", senderCb, new CommandException(GENERIC_FAILURE), new SmsResponse(mSmsRef.incrementAndGet(), ackPdu, -1));
}
}
}
diff --git a/src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java b/src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java
index 9ec43c0..f8ac028 100644
--- a/src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java
+++ b/src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java
@@ -19,20 +19,12 @@
package net.scintill.ril_ofono;
-import android.os.Message;
-import android.telephony.Rlog;
-
import org.freedesktop.dbus.Variant;
import org.ofono.Pair;
import org.ofono.SupplementaryServices;
-import static com.android.internal.telephony.CommandException.Error.GENERIC_FAILURE;
import static com.android.internal.telephony.CommandsInterface.USSD_MODE_NOTIFY;
import static com.android.internal.telephony.CommandsInterface.USSD_MODE_NOT_SUPPORTED;
-import static net.scintill.ril_ofono.RilOfono.privExc;
-import static net.scintill.ril_ofono.RilOfono.respondExc;
-import static net.scintill.ril_ofono.RilOfono.respondOk;
-import static net.scintill.ril_ofono.RilOfono.runOnDbusThread;
/*package*/ class SupplementaryServicesModule {
@@ -48,26 +40,16 @@ import static net.scintill.ril_ofono.RilOfono.runOnDbusThread;
}
@RilMethod
- public void sendUSSD(final String ussdString, final Message response) {
+ public Object sendUSSD(final String ussdString) {
// TODO network-initiated USSD. apparently they're rare, and it doesn't look like the rild backend of oFono supports them
- runOnDbusThread(new Runnable() {
- @Override
- public void run() {
- try {
- // TODO do on a separate thread? oFono docs seem to imply this will block everything anyway
- Pair<String, Variant> ussdResponse = mSupplSvcs.Initiate(ussdString);
- respondOk("sendUSSD", response, null);
- if (!ussdResponse.a.equals("USSD")) {
- mUSSDRegistrants.notifyResult(new String[]{""+USSD_MODE_NOT_SUPPORTED, null});
- } else {
- mUSSDRegistrants.notifyResult(new String[]{""+USSD_MODE_NOTIFY, (String) ussdResponse.b.getValue()});
- }
- } catch (Throwable t) {
- Rlog.e(TAG, "Error initiating USSD", privExc(t));
- respondExc("sendUSSD", response, GENERIC_FAILURE, null);
- }
- }
- });
+ // TODO do on a separate thread? oFono docs seem to imply this will block everything anyway
+ Pair<String, Variant> ussdResponse = mSupplSvcs.Initiate(ussdString);
+ if (!ussdResponse.a.equals("USSD")) {
+ mUSSDRegistrants.notifyResult(new String[]{""+USSD_MODE_NOT_SUPPORTED, null});
+ } else {
+ mUSSDRegistrants.notifyResult(new String[]{""+USSD_MODE_NOTIFY, (String) ussdResponse.b.getValue()});
+ }
+ return null;
}
}
diff --git a/start b/start
index cd22817..6681f8f 100755
--- a/start
+++ b/start
@@ -4,4 +4,4 @@ adb shell su root stop ril-daemon
adb shell su root start dbus
adb shell su root start qmiserial2qmuxd
adb shell su root start ofonod
-adb shell setprop debug.scintill.ril_class net.scintill.ril_ofono/.RilOfono \; killall com.android.phone
+adb shell setprop ril.ril_class net.scintill.ril_ofono/.RilWrapper \; killall com.android.phone
diff --git a/stop b/stop
index 727242f..4266088 100755
--- a/stop
+++ b/stop
@@ -3,4 +3,4 @@ adb shell su root stop ofonod
adb shell su root stop qmiserial2qmuxd
adb shell su root stop dbus
adb shell su root start ril-daemon
-adb shell setprop debug.scintill.ril_class '""' \; killall com.android.phone
+adb shell setprop ril.ril_class '""' \; killall com.android.phone