summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoey Hewitt <joey@joeyhewitt.com>2017-09-03 20:17:23 -0700
committerJoey Hewitt <joey@joeyhewitt.com>2017-09-03 20:17:23 -0700
commit728fbfa8d6ce3c7305071cca8494fa993ff3be9b (patch)
tree94c42963eb9996e5bad1172bb16bf00343430730
parentbcbbaefd41edb060f970d2bd050ff24487cb42c1 (diff)
downloadframeworks_opt_telephony_ril_ofono-728fbfa8d6ce3c7305071cca8494fa993ff3be9b.tar.gz
frameworks_opt_telephony_ril_ofono-728fbfa8d6ce3c7305071cca8494fa993ff3be9b.tar.bz2
frameworks_opt_telephony_ril_ofono-728fbfa8d6ce3c7305071cca8494fa993ff3be9b.zip
wrapper selectively sends method calls to dbus thread
Methods can mark themselves as safe to run on main thread, in which case they will not be sent to the dbus thread. A lot are safe for main thread, because they either always return UNSUPPORTED, or they just return some props we've been keeping up-to-date.
-rw-r--r--build/java/net/scintill/ril_ofono/BuildRilWrapper.java41
-rw-r--r--src/java/net/scintill/ril_ofono/DatacallModule.java (renamed from src/java/net/scintill/ril_ofono/DataConnModule.java)19
-rw-r--r--src/java/net/scintill/ril_ofono/ModemModule.java32
-rw-r--r--src/java/net/scintill/ril_ofono/RilMiscInterface.java4
-rw-r--r--src/java/net/scintill/ril_ofono/RilOfono.java124
-rw-r--r--src/java/net/scintill/ril_ofono/RilSimInterface.java4
-rw-r--r--src/java/net/scintill/ril_ofono/SimModule.java21
-rw-r--r--src/java/net/scintill/ril_ofono/SmsModule.java2
-rw-r--r--src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java2
-rw-r--r--src/java/net/scintill/ril_ofono/VoicecallModule.java (renamed from src/java/net/scintill/ril_ofono/CallModule.java)19
10 files changed, 197 insertions, 71 deletions
diff --git a/build/java/net/scintill/ril_ofono/BuildRilWrapper.java b/build/java/net/scintill/ril_ofono/BuildRilWrapper.java
index 450ab81..fc805c9 100644
--- a/build/java/net/scintill/ril_ofono/BuildRilWrapper.java
+++ b/build/java/net/scintill/ril_ofono/BuildRilWrapper.java
@@ -68,25 +68,30 @@ public class BuildRilWrapper {
}); // for comparing with old manually autogenned code
for (Method commandsIfaceMethod : commandsIfaceMethods) {
- Class<?> moduleIface = findModuleInterface(commandsIfaceMethod);
- if (moduleIface == null) {
+ Class<?>[] paramTypesExcludingMessage = getParameterTypesExcludingMessage(commandsIfaceMethod).toArray(new Class<?>[0]);
+ Class<?> moduleClass = findModuleClass(commandsIfaceMethod, paramTypesExcludingMessage);
+ if (moduleClass == null) {
continue; // <---
}
+ Method moduleMethod = moduleClass.getMethod(commandsIfaceMethod.getName(), paramTypesExcludingMessage);
os.println(getMethodSignature(commandsIfaceMethod) + " {");
String messageParamName = "msg";
Class[] paramTypes = commandsIfaceMethod.getParameterTypes();
- boolean isAsync = getParameterTypesExcludingMessage(commandsIfaceMethod).size() != paramTypes.length;
+ boolean isAsync = paramTypesExcludingMessage.length != paramTypes.length;
+ boolean isOkOnMainThread = moduleMethod.isAnnotationPresent(OkOnMainThread.class);
if (isAsync) {
- os.println("runOnDbusThread(new Runnable() {");
- os.println("public void run() {");
+ if (!isOkOnMainThread) {
+ os.println("runOnDbusThread(new Runnable() {");
+ os.println("public void run() {");
+ }
os.println("sCurrentMsg = msg;");
os.println("try {");
os.print("Object ret = ");
} else {
throw new RuntimeException("is not async! generation of synchronous methods not implemented");
}
- String moduleVarName = "m"+moduleIface.getSimpleName().replace("Interface", "Module").replace("Ril", "");
+ String moduleVarName = "m"+(moduleClass != RilOfono.class ? moduleClass.getSimpleName() : "MiscModule");
os.print(moduleVarName+"." + commandsIfaceMethod.getName() + "(");
char paramName = 'a';
for (Class<?> paramType : paramTypes) {
@@ -106,8 +111,10 @@ public class BuildRilWrapper {
os.println("Rlog.e(TAG, \"Uncaught exception in " + commandsIfaceMethod.getName() + "\", privExc(thr));");
os.println("respondExc(\"" + commandsIfaceMethod.getName() + "\", " + messageParamName + ", new CommandException(GENERIC_FAILURE), null);");
os.println("}");
- os.println("}");
- os.println("});");
+ if (!isOkOnMainThread) {
+ os.println("}");
+ os.println("});");
+ }
os.println("}");
os.println();
}
@@ -156,21 +163,21 @@ public class BuildRilWrapper {
return list;
}
- private static final Class<?>[] moduleIfaces = new Class<?>[] {
- RilModemInterface.class, RilSmsInterface.class, RilSimInterface.class,
- RilVoicecallInterface.class, RilDatacallInterface.class,
- RilSupplementaryServicesInterface.class,
- RilMiscInterface.class,
+ private static final Class<?>[] moduleClasses = new Class<?>[] {
+ ModemModule.class, SmsModule.class, SimModule.class,
+ VoicecallModule.class, DatacallModule.class,
+ SupplementaryServicesModule.class,
+ RilOfono.class,
};
- private static Class<?> findModuleInterface(Method commandsIfaceMethod) {
- for (Class<?> moduleIface : moduleIfaces) {
+ private static Class<?> findModuleClass(Method commandsIfaceMethod, Class[] paramTypesExcludingMessage) {
+ for (Class<?> moduleClass : moduleClasses) {
try {
- moduleIface.getMethod(commandsIfaceMethod.getName(), getParameterTypesExcludingMessage(commandsIfaceMethod).toArray(new Class<?>[0]));
+ moduleClass.getMethod(commandsIfaceMethod.getName(), paramTypesExcludingMessage);
} catch (NoSuchMethodException e) {
continue; // <--
}
- return moduleIface;
+ return moduleClass;
}
return null;
}
diff --git a/src/java/net/scintill/ril_ofono/DataConnModule.java b/src/java/net/scintill/ril_ofono/DatacallModule.java
index 576c3d7..11a4ecd 100644
--- a/src/java/net/scintill/ril_ofono/DataConnModule.java
+++ b/src/java/net/scintill/ril_ofono/DatacallModule.java
@@ -50,7 +50,7 @@ import static net.scintill.ril_ofono.RilOfono.notifyResultAndLog;
import static net.scintill.ril_ofono.RilOfono.privStr;
import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
-/*package*/ class DataConnModule extends PropManager implements RilDatacallInterface {
+/*package*/ class DatacallModule extends PropManager implements RilDatacallInterface {
private static final String TAG = RilOfono.TAG;
@@ -60,7 +60,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
private final Map<String, Variant<?>> mConnManProps = new HashMap<>();
private final Map<String, Map<String, Variant<?>>> mConnectionsProps = new HashMap<>();
- DataConnModule(RegistrantList dataNetworkStateRegistrants) {
+ DatacallModule(RegistrantList dataNetworkStateRegistrants) {
mDataNetworkStateRegistrants = dataNetworkStateRegistrants;
mConnMan = RilOfono.sInstance.getOfonoInterface(ConnectionManager.class);
@@ -71,7 +71,8 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
RilOfono.sInstance.registerDbusSignal(ConnectionContext.PropertyChanged.class, this);
}
- @RilMethod
+ @Override
+ @OkOnMainThread
public Object getDataRegistrationState() {
return new String[] {
// see e.g. GsmServiceStateTracker for the values and offsets, though some appear unused
@@ -81,12 +82,13 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
};
}
- @RilMethod
+ @Override
+ @OkOnMainThread
public Object getDataCallList() {
return new PrivResponseOb(getDataCallListImpl());
}
- @RilMethod
+ @Override
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);
@@ -117,7 +119,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
return new PrivResponseOb(getDataCallResponse(ctxPath.getPath(), ctx.GetProperties()));
}
- @RilMethod
+ @Override
public Object deactivateDataCall(int cid, int reason) {
Rlog.d(TAG, "deactivateDataCall "+cid+" "+reason);
String path = getPathFromUniqueIntId(cid);
@@ -174,7 +176,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
return list;
}
- @RilMethod
+ @Override
public Object setDataAllowed(boolean allowed) {
Rlog.d(TAG, "setDataAllowed " + allowed);
/*
@@ -188,7 +190,8 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
return null;
}
- @RilMethod
+ @Override
+ @OkOnMainThread
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
throw new CommandException(REQUEST_NOT_SUPPORTED);
diff --git a/src/java/net/scintill/ril_ofono/ModemModule.java b/src/java/net/scintill/ril_ofono/ModemModule.java
index 22b2b2f..bceb1b8 100644
--- a/src/java/net/scintill/ril_ofono/ModemModule.java
+++ b/src/java/net/scintill/ril_ofono/ModemModule.java
@@ -76,19 +76,22 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
mirrorProps(NetworkRegistration.class, mNetReg, NetworkRegistration.PropertyChanged.class, mNetRegProps);
}
- @RilMethod
+ @Override
+ @OkOnMainThread
public Object getIMEI() {
// TODO GSM-specific?
return new PrivResponseOb(getProp(mModemProps, "Serial", ""));
}
- @RilMethod
+ @Override
+ @OkOnMainThread
public Object getIMEISV() {
// TODO GSM-specific?
return new PrivResponseOb(getProp(mModemProps, "SoftwareVersionNumber", ""));
}
- @RilMethod
+ @Override
+ @OkOnMainThread
public Object getSignalStrength() {
// TODO gsm-specific
Byte signalPercent = getProp(mNetRegProps, "Strength", (Byte)null);
@@ -97,7 +100,8 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
99, -1, -1, -1, -1, -1, true);
}
- @RilMethod
+ @Override
+ @OkOnMainThread
public Object getVoiceRegistrationState() {
OfonoRegistrationState state = getProp(mNetRegProps, "Status", OfonoRegistrationState.unknown);
if (!state.isRegistered()) {
@@ -112,7 +116,8 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
}
- @RilMethod
+ @Override
+ @OkOnMainThread
public Object getOperator() {
String STAR_EMOJI = "🌠";
@@ -131,7 +136,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
}
- @RilMethod
+ @Override
public Object setRadioPower(final boolean on) {
Rlog.v(TAG, "setRadioPower("+on+")");
@@ -139,7 +144,8 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
return null;
}
- @RilMethod
+ @Override
+ @OkOnMainThread
public Object getNetworkSelectionMode() {
String mode = getProp(mNetRegProps, "Mode", (String)null);
if (mode == null) {
@@ -149,14 +155,16 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
}
- @RilMethod
+ @Override
+ @OkOnMainThread
public Object getBasebandVersion() {
return getProp(mModemProps, "Revision", "");
}
- @RilMethod
+ @Override
+ @OkOnMainThread
public Object getVoiceRadioTechnology() {
- return getVoiceRadioTechnologyAsyncResult();
+ return getVoiceRadioTechnologyImpl();
}
protected void onPropChange(Modem modem, String name, Variant<?> value) {
@@ -179,7 +187,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
@Override
public void run() {
notifyResultAndLog("voice netstate", mVoiceNetworkStateRegistrants, null, false);
- notifyResultAndLog("voice radiotech changed", mVoiceRadioTechChangedRegistrants, getVoiceRadioTechnologyAsyncResult(), false);
+ notifyResultAndLog("voice radiotech changed", mVoiceRadioTechChangedRegistrants, getVoiceRadioTechnologyImpl(), false);
}
};
@@ -247,7 +255,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
}
- private Object getVoiceRadioTechnologyAsyncResult() {
+ private Object getVoiceRadioTechnologyImpl() {
// TODO is this really the right value?
OfonoNetworkTechnology tech = getProp(mNetRegProps, "Technology", OfonoNetworkTechnology._unknown);
return new int[]{ tech.serviceStateInt };
diff --git a/src/java/net/scintill/ril_ofono/RilMiscInterface.java b/src/java/net/scintill/ril_ofono/RilMiscInterface.java
index 1989738..994fb91 100644
--- a/src/java/net/scintill/ril_ofono/RilMiscInterface.java
+++ b/src/java/net/scintill/ril_ofono/RilMiscInterface.java
@@ -86,8 +86,6 @@ interface RilMiscInterface {
Object getMute();
- Object getIMSI();
-
Object sendDtmf(char c);
Object startDtmf(char c);
@@ -118,8 +116,6 @@ interface RilMiscInterface {
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 queryCLIP();
Object getCLIR();
diff --git a/src/java/net/scintill/ril_ofono/RilOfono.java b/src/java/net/scintill/ril_ofono/RilOfono.java
index f75e6bf..80a33e2 100644
--- a/src/java/net/scintill/ril_ofono/RilOfono.java
+++ b/src/java/net/scintill/ril_ofono/RilOfono.java
@@ -93,8 +93,8 @@ public class RilOfono implements RilMiscInterface {
mRilWrapper.mModemModule = new ModemModule(mRilWrapper.mVoiceNetworkStateRegistrants, mRilWrapper.mVoiceRadioTechChangedRegistrants, mRilWrapper.mSignalStrengthRegistrants);
mRilWrapper.mSmsModule = new SmsModule(mRilWrapper.mGsmSmsRegistrants); // TODO gsm-specific
mRilWrapper.mSimModule = new SimModule(mRilWrapper.mIccStatusChangedRegistrants);
- mRilWrapper.mVoicecallModule = new CallModule(mRilWrapper.mCallStateRegistrants);
- mRilWrapper.mDatacallModule = new DataConnModule(mRilWrapper.mDataNetworkStateRegistrants);
+ mRilWrapper.mVoicecallModule = new VoicecallModule(mRilWrapper.mCallStateRegistrants);
+ mRilWrapper.mDatacallModule = new DatacallModule(mRilWrapper.mDataNetworkStateRegistrants);
mRilWrapper.mSupplementaryServicesModule = new SupplementaryServicesModule(mRilWrapper.mUSSDRegistrants);
((ModemModule)mRilWrapper.mModemModule).onModemChange(false); // initialize starting state
} catch (Throwable t) {
@@ -128,181 +128,211 @@ public class RilOfono implements RilMiscInterface {
}
@Override
+ @OkOnMainThread
public Object getImsRegistrationState() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setSuppServiceNotifications(boolean enable) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object supplyIccPin(String pin) {
return supplyIccPinForApp(pin, null);
}
@Override
+ @OkOnMainThread
public Object supplyIccPinForApp(String pin, String aid) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object supplyIccPuk(String puk, String newPin) {
return supplyIccPukForApp(puk, newPin, null);
}
@Override
+ @OkOnMainThread
public Object supplyIccPukForApp(String puk, String newPin, String aid) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object supplyIccPin2(String pin2) {
return supplyIccPin2ForApp(pin2, null);
}
@Override
+ @OkOnMainThread
public Object supplyIccPin2ForApp(String pin2, String aid) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object supplyIccPuk2(String puk2, String newPin2) {
return supplyIccPuk2ForApp(puk2, newPin2, null);
}
@Override
+ @OkOnMainThread
public Object supplyIccPuk2ForApp(String puk2, String newPin2, String aid) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object changeIccPin(String oldPin, String newPin) {
return changeIccPin2ForApp(oldPin, newPin, null);
}
@Override
+ @OkOnMainThread
public Object changeIccPinForApp(String oldPin, String newPin, String aidPtr) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object changeIccPin2(String oldPin2, String newPin2) {
return changeIccPin2ForApp(oldPin2, newPin2, null);
}
@Override
+ @OkOnMainThread
public Object changeIccPin2ForApp(String oldPin2, String newPin2, String aidPtr) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object changeBarringPassword(String facility, String oldPwd, String newPwd) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object supplyDepersonalization(String netpin, String type) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getPDPContextList() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getDataCallProfile(int appType) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setDataProfile(DataProfile[] dps) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object hangupForegroundResumeBackground() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object switchWaitingOrHoldingAndActive() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object conference() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setPreferredVoicePrivacy(boolean enable) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getPreferredVoicePrivacy() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object separateConnection(int gsmIndex) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object explicitCallTransfer() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getLastCallFailCause() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getLastPdpFailCause() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getLastDataCallFailCause() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setMute(boolean enableMute) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getMute() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- public Object getIMSI() {
- return mRilWrapper.mSimModule.getIMSIForApp(null);
- }
-
- @Override
+ @OkOnMainThread
public Object sendDtmf(char c) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object startDtmf(char c) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object stopDtmf() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object sendBurstDtmf(String dtmfString, int on, int off) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@@ -314,341 +344,403 @@ public class RilOfono implements RilMiscInterface {
}
@Override
+ @OkOnMainThread
public Object sendCdmaSms(byte[] pdu) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object sendImsGsmSms(String smscPDU, String pdu, int retry, int messageRef) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object sendImsCdmaSms(byte[] pdu, int retry, int messageRef) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object deleteSmsOnSim(int index) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object deleteSmsOnRuim(int index) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object writeSmsToSim(int status, String smsc, String pdu) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object writeSmsToRuim(int status, String pdu) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object acknowledgeLastIncomingGsmSms(boolean success, int cause) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object acknowledgeLastIncomingCdmaSms(boolean success, int cause) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object acknowledgeIncomingGsmSmsWithPdu(boolean success, String ackPdu) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
- public Object iccIO(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2) {
- return mRilWrapper.mSimModule.iccIOForApp(command, fileid, path, p1, p2, p3, data, pin2, null);
- }
-
- @Override
+ @OkOnMainThread
public Object queryCLIP() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getCLIR() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setCLIR(int clirMode) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object queryCallWaiting(int serviceClass) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setCallWaiting(boolean enable, int serviceClass) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setCallForward(int action, int cfReason, int serviceClass, String number, int timeSeconds) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object queryCallForwardStatus(int cfReason, int serviceClass, String number) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setNetworkSelectionModeAutomatic() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setNetworkSelectionModeManual(String operatorNumeric) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getAvailableNetworks() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object queryFacilityLock(String facility, String password, int serviceClass) {
return queryFacilityLockForApp(facility, password, serviceClass, null);
}
@Override
+ @OkOnMainThread
public Object queryFacilityLockForApp(String facility, String password, int serviceClass, String appId) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setFacilityLock(String facility, boolean lockState, String password, int serviceClass) {
return setFacilityLockForApp(facility, lockState, password, serviceClass, null);
}
@Override
+ @OkOnMainThread
public Object setFacilityLockForApp(String facility, boolean lockState, String password, int serviceClass, String appId) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object cancelPendingUssd() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object resetRadio() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setBandMode(int bandMode) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object queryAvailableBandMode() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setPreferredNetworkType(int networkType) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getPreferredNetworkType() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getNeighboringCids() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setLocationUpdates(boolean enable) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getSmscAddress() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setSmscAddress(String address) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object reportSmsMemoryStatus(boolean available) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object reportStkServiceIsRunning() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object invokeOemRilRequestRaw(byte[] data) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object invokeOemRilRequestStrings(String[] strings) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object sendTerminalResponse(String contents) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object sendEnvelope(String contents) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object sendEnvelopeWithStatus(String contents) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object handleCallSetupRequestFromSim(boolean accept) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setGsmBroadcastActivation(boolean activate) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getGsmBroadcastConfig() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getDeviceIdentity() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getCDMASubscription() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object sendCDMAFeatureCode(String FeatureCode) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object queryCdmaRoamingPreference() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setCdmaRoamingPreference(int cdmaRoamingType) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setCdmaSubscriptionSource(int cdmaSubscriptionType) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getCdmaSubscriptionSource() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setTTYMode(int ttyMode) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object queryTTYMode() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setCdmaBroadcastActivation(boolean activate) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getCdmaBroadcastConfig() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object exitEmergencyCallbackMode() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object requestIsimAuthentication(String nonce) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object requestIccSimAuthentication(int authContext, String data, String aid) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getCellInfoList() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object setCellInfoListRate(int rateInMillis) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object nvReadItem(int itemID) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object nvWriteItem(int itemID, String itemValue) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object nvWriteCdmaPrl(byte[] preferredRoamingList) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object nvResetConfig(int resetType) {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@Override
+ @OkOnMainThread
public Object getHardwareConfig() {
throw new CommandException(REQUEST_NOT_SUPPORTED);
}
@@ -853,9 +945,9 @@ public class RilOfono implements RilMiscInterface {
// mostly a tag type to remind me use this correctly (only construct one for each purpose)
/*package*/ abstract class DebouncedRunnable implements Runnable {}
-// simple human-oriented marker saying that the annotated method is part of the RIL interface
-// (useful for the module classes that mix more internal methods)
-@Retention(RetentionPolicy.SOURCE)
+// does not need to be available at true runtime, just when BuildRilWrapper runs, but
+// I'm not sure that can be done without spelunking into classfiles
+@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
-/*package*/ @interface RilMethod {
+/*package*/ @interface OkOnMainThread {
}
diff --git a/src/java/net/scintill/ril_ofono/RilSimInterface.java b/src/java/net/scintill/ril_ofono/RilSimInterface.java
index a1cd30a..4291903 100644
--- a/src/java/net/scintill/ril_ofono/RilSimInterface.java
+++ b/src/java/net/scintill/ril_ofono/RilSimInterface.java
@@ -23,8 +23,12 @@ interface RilSimInterface {
Object getIccCardStatus();
+ Object getIMSI();
+
Object getIMSIForApp(String aid);
Object iccIOForApp(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2, String aid);
+ Object iccIO(int command, int fileid, String path, int p1, int p2, int p3, String data, String pin2);
+
}
diff --git a/src/java/net/scintill/ril_ofono/SimModule.java b/src/java/net/scintill/ril_ofono/SimModule.java
index 7da18b0..f1bbed0 100644
--- a/src/java/net/scintill/ril_ofono/SimModule.java
+++ b/src/java/net/scintill/ril_ofono/SimModule.java
@@ -59,12 +59,20 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
mirrorProps(MessageWaiting.class, msgWaiting, MessageWaiting.PropertyChanged.class, mMsgWaitingProps);
}
- @RilMethod
+ @Override
+ @OkOnMainThread
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
+ @Override
+ @OkOnMainThread
+ 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
+ @OkOnMainThread
public Object getIMSIForApp(String aid) {
// TODO GSM-specific?
String imsi = getProp(mSimProps, "SubscriberIdentity", (String)null);
@@ -75,7 +83,14 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
}
- @RilMethod
+ @Override
+ @OkOnMainThread
+ public Object getIMSI() {
+ return getIMSIForApp(null);
+ }
+
+ @Override
+ @OkOnMainThread
public Object getIccCardStatus() {
// TODO GSM-specific? can we/should we do more?
IccCardStatus cardStatus = new IccCardStatus();
diff --git a/src/java/net/scintill/ril_ofono/SmsModule.java b/src/java/net/scintill/ril_ofono/SmsModule.java
index b85399c..810ca15 100644
--- a/src/java/net/scintill/ril_ofono/SmsModule.java
+++ b/src/java/net/scintill/ril_ofono/SmsModule.java
@@ -62,7 +62,7 @@ import static net.scintill.ril_ofono.RilOfono.respondOk;
RilOfono.sInstance.registerDbusSignal(org.ofono.Message.PropertyChanged.class, this);
}
- @RilMethod
+ @Override
public Object sendSMS(String smscPDUStr, String pduStr) {
Rlog.d(TAG, "sendSMS");
// TODO gsm-specific?
diff --git a/src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java b/src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java
index 9830d12..16088bd 100644
--- a/src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java
+++ b/src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java
@@ -39,7 +39,7 @@ import static com.android.internal.telephony.CommandsInterface.USSD_MODE_NOT_SUP
mSupplSvcs = RilOfono.sInstance.getOfonoInterface(SupplementaryServices.class);
}
- @RilMethod
+ @Override
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
// TODO do on a separate thread? oFono docs seem to imply this will block everything anyway
diff --git a/src/java/net/scintill/ril_ofono/CallModule.java b/src/java/net/scintill/ril_ofono/VoicecallModule.java
index 7f1d75f..2d4cd89 100644
--- a/src/java/net/scintill/ril_ofono/CallModule.java
+++ b/src/java/net/scintill/ril_ofono/VoicecallModule.java
@@ -49,14 +49,14 @@ import static net.scintill.ril_ofono.RilOfono.privExc;
import static net.scintill.ril_ofono.RilOfono.privStr;
import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
-/*package*/ class CallModule extends PropManager implements RilVoicecallInterface {
+/*package*/ class VoicecallModule extends PropManager implements RilVoicecallInterface {
private static String TAG = RilOfono.TAG;
private VoiceCallManager mCallManager;
private RegistrantList mCallStateRegistrants;
- /*package*/ CallModule(RegistrantList callStateRegistrants) {
+ /*package*/ VoicecallModule(RegistrantList callStateRegistrants) {
mCallStateRegistrants = callStateRegistrants;
mCallManager = RilOfono.sInstance.getOfonoInterface(VoiceCallManager.class);
@@ -66,7 +66,8 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
RilOfono.sInstance.registerDbusSignal(VoiceCallManager.CallRemoved.class, this);
}
- @RilMethod
+ @Override
+ @OkOnMainThread
public Object getCurrentCalls() {
List<DriverCall> calls = new ArrayList<>(mCallsProps.size());
//Rlog.d(TAG, "mCallsProps= "+privStr(mCallsProps));
@@ -144,7 +145,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
return null;
}
- @RilMethod
+ @Override
public Object dial(final String address, int clirMode) {
final String clirModeStr;
switch (clirMode) {
@@ -163,7 +164,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
return null;
}
- @RilMethod
+ @Override
public Object dial(String address, int clirMode, UUSInfo uusInfo) {
if (uusInfo != null) {
throw new CommandException(MODE_NOT_SUPPORTED);
@@ -172,7 +173,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
}
- @RilMethod
+ @Override
public Object hangupConnection(final int gsmIndex) {
String callPath = getDbusPathForCallIndex(gsmIndex);
if (callPath == null) {
@@ -183,7 +184,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
return null;
}
- @RilMethod
+ @Override
public Object hangupWaitingOrBackground() {
boolean oneSucceeded = false, oneExcepted = false;
for (Map.Entry<String, Map<String, Variant<?>>> callPropsEntry : mCallsProps.entrySet()) {
@@ -220,7 +221,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
}
}
- @RilMethod
+ @Override
public Object acceptCall() {
for (Map.Entry<String, Map<String, Variant<?>>> callPropsEntry : mCallsProps.entrySet()) {
String callPath = callPropsEntry.getKey();
@@ -235,7 +236,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced;
throw new CommandException(CommandException.Error.NO_SUCH_ELEMENT);
}
- @RilMethod
+ @Override
public Object rejectCall() {
// TODO RIL.java sends UDUB, which may not be the same as what we're indirectly asking oFono to do here
return hangupWaitingOrBackground();