diff options
| author | Joey Hewitt <joey@joeyhewitt.com> | 2017-09-02 14:20:40 -0700 |
|---|---|---|
| committer | Joey Hewitt <joey@joeyhewitt.com> | 2017-09-02 14:20:40 -0700 |
| commit | 1213e404cc8d77ddf2fafe6d45d849f83ae01ce8 (patch) | |
| tree | ee920353413edac18ae80b27807e30bed191749c | |
| parent | cbf07bef8a0f777dbdccc3c8218d36dcb5b78c59 (diff) | |
| download | frameworks_opt_telephony_ril_ofono-1213e404cc8d77ddf2fafe6d45d849f83ae01ce8.tar.gz frameworks_opt_telephony_ril_ofono-1213e404cc8d77ddf2fafe6d45d849f83ae01ce8.tar.bz2 frameworks_opt_telephony_ril_ofono-1213e404cc8d77ddf2fafe6d45d849f83ae01ce8.zip | |
fix warnings, such as raw types
| -rw-r--r-- | Android.mk | 16 | ||||
| -rw-r--r-- | lib/java/ofono/org/ofono/ConnectionContext.java | 4 | ||||
| -rw-r--r-- | lib/java/ofono/org/ofono/ConnectionManager.java | 4 | ||||
| -rw-r--r-- | lib/java/ofono/org/ofono/StructPathAndProps.java | 4 | ||||
| -rw-r--r-- | lib/java/ofono/org/ofono/SupplementaryServices.java | 2 | ||||
| -rw-r--r-- | lib/java/ofono/org/ofono/VoiceCallManager.java | 4 | ||||
| -rw-r--r-- | src/java/net/scintill/ril_ofono/CallModule.java | 18 | ||||
| -rw-r--r-- | src/java/net/scintill/ril_ofono/DataConnModule.java | 14 | ||||
| -rw-r--r-- | src/java/net/scintill/ril_ofono/ModemModule.java | 8 | ||||
| -rw-r--r-- | src/java/net/scintill/ril_ofono/PropManager.java | 43 | ||||
| -rw-r--r-- | src/java/net/scintill/ril_ofono/RilWrapper.java | 5 | ||||
| -rw-r--r-- | src/java/net/scintill/ril_ofono/SimFiles.java | 6 | ||||
| -rw-r--r-- | src/java/net/scintill/ril_ofono/SimModule.java | 20 | ||||
| -rw-r--r-- | src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java | 2 | ||||
| -rw-r--r-- | src/java/net/scintill/ril_ofono/Utils.java | 4 |
15 files changed, 80 insertions, 74 deletions
@@ -17,17 +17,23 @@ LOCAL_PATH := $(call my-dir) -# Build our Java RIL +# Build libraries (separately so we can ignore warnings) include $(CLEAR_VARS) - LOCAL_PACKAGE_NAME := RilOfono - LOCAL_SRC_FILES := $(call all-java-files-under,src/java) \ - $(call all-java-files-under,lib/java/dbus) \ + LOCAL_MODULE := RilOfono.libs + LOCAL_SRC_FILES := $(call all-java-files-under,lib/java/dbus) \ $(call all-java-files-under,lib/java/debug) \ $(call all-java-files-under,lib/java/ofono) +include $(BUILD_STATIC_JAVA_LIBRARY) + +# Build our Java RIL +include $(CLEAR_VARS) + LOCAL_PACKAGE_NAME := RilOfono + LOCAL_SRC_FILES := $(call all-java-files-under,src/java) + LOCAL_STATIC_JAVA_LIBRARIES := RilOfono.libs LOCAL_JAVA_LIBRARIES := telephony-common LOCAL_CERTIFICATE := platform - LOCAL_JAVACFLAGS += -Xlint:deprecation -Xlint:unchecked + LOCAL_JAVACFLAGS := -Xlint # TODO not sure what we *should* do with these, but for now it seems easier to get going by turning them off... LOCAL_DEX_PREOPT := false diff --git a/lib/java/ofono/org/ofono/ConnectionContext.java b/lib/java/ofono/org/ofono/ConnectionContext.java index 508f77f..160cb56 100644 --- a/lib/java/ofono/org/ofono/ConnectionContext.java +++ b/lib/java/ofono/org/ofono/ConnectionContext.java @@ -9,7 +9,7 @@ public interface ConnectionContext extends DBusInterface public static class PropertyChanged extends DBusSignal { public final String name; - public final Variant value; + public final Variant<?> value; public PropertyChanged(String path, String name, Variant value) throws DBusException { super(path, name, value); @@ -18,7 +18,7 @@ public interface ConnectionContext extends DBusInterface } } - public Map<String,Variant> GetProperties(); + public Map<String,Variant<?>> GetProperties(); public void SetProperty(String property, Variant value); } diff --git a/lib/java/ofono/org/ofono/ConnectionManager.java b/lib/java/ofono/org/ofono/ConnectionManager.java index a172b45..10a2ded 100644 --- a/lib/java/ofono/org/ofono/ConnectionManager.java +++ b/lib/java/ofono/org/ofono/ConnectionManager.java @@ -22,8 +22,8 @@ public interface ConnectionManager extends DBusInterface public static class ContextAdded extends DBusSignal { public final Path path; - public final Map<String,Variant> properties; - public ContextAdded(String path, Path path2, Map<String,Variant> properties) throws DBusException + public final Map<String,Variant<?>> properties; + public ContextAdded(String path, Path path2, Map<String,Variant<?>> properties) throws DBusException { super(path, path2, properties); this.path = path2; diff --git a/lib/java/ofono/org/ofono/StructPathAndProps.java b/lib/java/ofono/org/ofono/StructPathAndProps.java index 9fe22f3..7c809aa 100644 --- a/lib/java/ofono/org/ofono/StructPathAndProps.java +++ b/lib/java/ofono/org/ofono/StructPathAndProps.java @@ -10,8 +10,8 @@ public final class StructPathAndProps extends Struct @Position(0) public final Path path; @Position(1) - public final Map<String,Variant> props; - public StructPathAndProps(Path a, Map<String,Variant> b) + public final Map<String,Variant<?>> props; + public StructPathAndProps(Path a, Map<String,Variant<?>> b) { this.path = a; this.props = b; diff --git a/lib/java/ofono/org/ofono/SupplementaryServices.java b/lib/java/ofono/org/ofono/SupplementaryServices.java index d18fa05..c1cdb2a 100644 --- a/lib/java/ofono/org/ofono/SupplementaryServices.java +++ b/lib/java/ofono/org/ofono/SupplementaryServices.java @@ -36,7 +36,7 @@ public interface SupplementaryServices extends DBusInterface } } - public Pair<String, Variant> Initiate(String command); + public Pair<String, Variant<?>> Initiate(String command); public String Respond(String reply); public void Cancel(); public Map<String,Variant> GetProperties(); diff --git a/lib/java/ofono/org/ofono/VoiceCallManager.java b/lib/java/ofono/org/ofono/VoiceCallManager.java index 52b520d..0d913ef 100644 --- a/lib/java/ofono/org/ofono/VoiceCallManager.java +++ b/lib/java/ofono/org/ofono/VoiceCallManager.java @@ -40,8 +40,8 @@ public interface VoiceCallManager extends DBusInterface public static class CallAdded extends DBusSignal { public final Path path; - public final Map<String,Variant> properties; - public CallAdded(String vcmPath, Path path, Map<String,Variant> properties) throws DBusException + public final Map<String,Variant<?>> properties; + public CallAdded(String vcmPath, Path path, Map<String,Variant<?>> properties) throws DBusException { super(vcmPath, path, properties); this.path = path; diff --git a/src/java/net/scintill/ril_ofono/CallModule.java b/src/java/net/scintill/ril_ofono/CallModule.java index 5dcbfd8..21ad817 100644 --- a/src/java/net/scintill/ril_ofono/CallModule.java +++ b/src/java/net/scintill/ril_ofono/CallModule.java @@ -70,7 +70,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; public Object getCurrentCalls() { List<DriverCall> calls = new ArrayList<>(mCallsProps.size()); //Rlog.d(TAG, "mCallsProps= "+privStr(mCallsProps)); - for (Map<String, Variant> callProps : mCallsProps.values()) { + 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); @@ -98,7 +98,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; return new PrivResponseOb(calls); } - private final Map<String, Map<String, Variant>> mCallsProps = new HashMap<>(); + private final Map<String, Map<String, Variant<?>>> mCallsProps = new HashMap<>(); private ConcurrentLinkedQueue<Integer> mAvailableCallIndices; { mAvailableCallIndices = new ConcurrentLinkedQueue<>(); // GsmCallTracker.MAX_CONNECTIONS = 7, CDMA allows 8 @@ -111,7 +111,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; public void handle(VoiceCallManager.CallAdded s) { String callPath = s.path.getPath(); Rlog.d(TAG, "handle CallAdded "+ callPath); - Map<String, Variant> newCallProps = new HashMap<>(s.properties); + Map<String, Variant<?>> newCallProps = new HashMap<>(s.properties); newCallProps.put(PROPNAME_CALL_INDEX, new Variant<>(mAvailableCallIndices.remove())); putOrMerge2dProps(mCallsProps, callPath, newCallProps); @@ -135,7 +135,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; private String getDbusPathForCallIndex(int i) { synchronized (mCallsProps) { - for (Map.Entry<String, Map<String, Variant>> entry : mCallsProps.entrySet()) { + for (Map.Entry<String, Map<String, Variant<?>>> entry : mCallsProps.entrySet()) { if (getProp(entry.getValue(), PROPNAME_CALL_INDEX, -1) == i) { return entry.getKey(); } @@ -156,7 +156,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; } Path dialedCallPath = mCallManager.Dial(address, clirModeStr); - Map<String, Variant> dialedCallProps = new HashMap<>(); + 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()); @@ -186,9 +186,9 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; @RilMethod public Object hangupWaitingOrBackground() { boolean oneSucceeded = false, oneExcepted = false; - for (Map.Entry<String, Map<String, Variant>> callPropsEntry : mCallsProps.entrySet()) { + for (Map.Entry<String, Map<String, Variant<?>>> callPropsEntry : mCallsProps.entrySet()) { String callPath = callPropsEntry.getKey(); - Map<String, Variant> callProps = callPropsEntry.getValue(); + 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? @@ -222,9 +222,9 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; @RilMethod public Object acceptCall() { - for (Map.Entry<String, Map<String, Variant>> callPropsEntry : mCallsProps.entrySet()) { + for (Map.Entry<String, Map<String, Variant<?>>> callPropsEntry : mCallsProps.entrySet()) { String callPath = callPropsEntry.getKey(); - Map<String, Variant> callProps = callPropsEntry.getValue(); + 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(); diff --git a/src/java/net/scintill/ril_ofono/DataConnModule.java b/src/java/net/scintill/ril_ofono/DataConnModule.java index a59b933..dc17547 100644 --- a/src/java/net/scintill/ril_ofono/DataConnModule.java +++ b/src/java/net/scintill/ril_ofono/DataConnModule.java @@ -57,8 +57,8 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; private ConnectionManager mConnMan; private RegistrantList mDataNetworkStateRegistrants; - private final Map<String, Variant> mConnManProps = new HashMap<>(); - private final Map<String, Map<String, Variant>> mConnectionsProps = new HashMap<>(); + private final Map<String, Variant<?>> mConnManProps = new HashMap<>(); + private final Map<String, Map<String, Variant<?>>> mConnectionsProps = new HashMap<>(); DataConnModule(RegistrantList dataNetworkStateRegistrants) { mDataNetworkStateRegistrants = dataNetworkStateRegistrants; @@ -129,8 +129,8 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; return null; } - private DataCallResponse getDataCallResponse(String dbusPath, Map<String, Variant> props) { - Map<String, Variant> ipSettings = getProp(props, "Settings", new HashMap<String, Variant>()); + private DataCallResponse getDataCallResponse(String dbusPath, Map<String, Variant<?>> props) { + Map<String, Variant<?>> ipSettings = getProp(props, "Settings", new HashMap<String, Variant<?>>()); // TODO ipv6? if (!getProp(props, "Active", Boolean.FALSE)) { @@ -162,9 +162,9 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; 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()) { + for (Map.Entry<String, Map<String, Variant<?>>> connectionPropsEntry : mConnectionsProps.entrySet()) { String dbusPath = connectionPropsEntry.getKey(); - Map<String, Variant> props = connectionPropsEntry.getValue(); + Map<String, Variant<?>> props = connectionPropsEntry.getValue(); DataCallResponse dcr = getDataCallResponse(dbusPath, props); if (dcr != null) { list.add(dcr); @@ -204,7 +204,7 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; } } - public void onPropChange(ConnectionManager connMan, String name, Variant value) { + public void onPropChange(ConnectionManager connMan, String name, Variant<?> value) { if (name.equals("Attached")) { mConnectionsProps.clear(); if (value.getValue().equals(Boolean.TRUE)) { diff --git a/src/java/net/scintill/ril_ofono/ModemModule.java b/src/java/net/scintill/ril_ofono/ModemModule.java index dc8b13c..1f3fc73 100644 --- a/src/java/net/scintill/ril_ofono/ModemModule.java +++ b/src/java/net/scintill/ril_ofono/ModemModule.java @@ -58,9 +58,9 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; private final RilOfono.RegistrantList mSignalStrengthRegistrants; private Modem mModem; - private final Map<String, Variant> mModemProps = new HashMap<>(); + private final Map<String, Variant<?>> mModemProps = new HashMap<>(); private NetworkRegistration mNetReg; - private final Map<String, Variant> mNetRegProps = new HashMap<>(); + private final Map<String, Variant<?>> mNetRegProps = new HashMap<>(); /*package*/ ModemModule(RegistrantList voiceNetworkStateRegistrants, RegistrantList voiceRadioTechChangedRegistrants, RilOfono.RegistrantList signalStrengthRegistrants) { mVoiceNetworkStateRegistrants = voiceNetworkStateRegistrants; @@ -160,14 +160,14 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; return getVoiceRadioTechnologyAsyncResult(); } - protected void onPropChange(Modem modem, String name, Variant value) { + protected void onPropChange(Modem modem, String name, Variant<?> value) { if (name.equals("Online")) { final boolean online = (Boolean) value.getValue(); RilOfono.sInstance.setRadioState(online ? RadioState.RADIO_ON : RadioState.RADIO_OFF); } } - protected void onPropChange(NetworkRegistration netReg, String name, Variant value) { + protected void onPropChange(NetworkRegistration netReg, String name, Variant<?> value) { if (name.equals("Strength")) { notifyResultAndLog("signal strength", mSignalStrengthRegistrants, getSignalStrength(), false); } else { diff --git a/src/java/net/scintill/ril_ofono/PropManager.java b/src/java/net/scintill/ril_ofono/PropManager.java index c9fcd0c..0321d72 100644 --- a/src/java/net/scintill/ril_ofono/PropManager.java +++ b/src/java/net/scintill/ril_ofono/PropManager.java @@ -44,7 +44,7 @@ import static net.scintill.ril_ofono.RilOfono.privStr; private static final String TAG = RilOfono.TAG; - private static boolean logAndUpdateProp(Map<String, Variant> propsToUpdate, String thingChangingDebugRef, String name, Variant value) { + private static boolean logAndUpdateProp(Map<String, Variant<?>> propsToUpdate, String thingChangingDebugRef, String name, Variant<?> value) { boolean changed; //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (propsToUpdate) { @@ -56,15 +56,15 @@ import static net.scintill.ril_ofono.RilOfono.privStr; return changed; } - protected static boolean handle2dPropChange(Map<String, Map<String, Variant>> propsToUpdateRoot, String keyToUpdate, Class<?extends DBusInterface> dbusObIface, String name, Variant value) { - Map<String, Variant> propsToUpdate = propsToUpdateRoot.get(keyToUpdate); + protected static boolean handle2dPropChange(Map<String, Map<String, Variant<?>>> propsToUpdateRoot, String keyToUpdate, Class<?extends DBusInterface> dbusObIface, String name, Variant<?> value) { + Map<String, Variant<?>> propsToUpdate = propsToUpdateRoot.get(keyToUpdate); if (propsToUpdate == null) { propsToUpdateRoot.put(keyToUpdate, propsToUpdate = new HashMap<>()); } return logAndUpdateProp(propsToUpdate, dbusObIface.getSimpleName()+" "+keyToUpdate, name, value); } - protected static void putOrMerge2dProps(Map<String, Map<String, Variant>> rootProps, String key, Map<String, Variant> props) { + protected static void putOrMerge2dProps(Map<String, Map<String, Variant<?>>> rootProps, String key, Map<String, Variant<?>> props) { //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (rootProps) { if (!rootProps.containsKey(key)) { @@ -76,14 +76,15 @@ import static net.scintill.ril_ofono.RilOfono.privStr; } } - private void initProps(Map<String, Variant> propsToInit, Class<?extends DBusInterface> sourceObIface, DBusInterface sourceOb) { + private void initProps(Map<String, Variant<?>> propsToInit, Class<?extends DBusInterface> sourceObIface, DBusInterface sourceOb) { // load properties - Map<String, Variant> props; + Map<String, Variant<?>> props; try { Method m = sourceObIface.getMethod("GetProperties"); - //noinspection unchecked - props = (Map<String, Variant>) m.invoke(sourceOb); - } catch (NoSuchMethodException | IllegalAccessException e) { + @SuppressWarnings("unchecked") + Map<String, Variant<?>> o = (Map<String, Variant<?>>) m.invoke(sourceOb); + props = o; + } catch (NoSuchMethodException | IllegalAccessException | ClassCastException e) { throw new RuntimeException("unable to find GetProperties method", e); } catch (InvocationTargetException e) { try { @@ -99,10 +100,10 @@ import static net.scintill.ril_ofono.RilOfono.privStr; //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (propsToInit) { - propsToInit.clear(); // TODO notify about removed props? + propsToInit.clear(); try { Method m = this.getClass().getDeclaredMethod("onPropChange", sourceObIface, String.class, Variant.class); - for (Map.Entry<String, Variant> entry : props.entrySet()) { + for (Map.Entry<String, Variant<?>> entry : props.entrySet()) { logAndUpdateProp(propsToInit, sourceObIface.getSimpleName()+"#init", entry.getKey(), entry.getValue()); m.invoke(this, sourceOb, entry.getKey(), entry.getValue()); } @@ -118,7 +119,7 @@ import static net.scintill.ril_ofono.RilOfono.privStr; /* * The consuming class must have a method onPropChange(<sourceObIface> sourceOb, String name, Variant value) */ - protected <PropChangeSignalT extends DBusSignal> void mirrorProps(final Class<? extends DBusInterface> sourceObIface, final DBusInterface sourceOb, final Class<PropChangeSignalT> propChangeSignalClass, final Map<String, Variant> props) { + protected <PropChangeSignalT extends DBusSignal> void mirrorProps(final Class<? extends DBusInterface> sourceObIface, final DBusInterface sourceOb, final Class<PropChangeSignalT> propChangeSignalClass, final Map<String, Variant<?>> props) { try { final Field fName = propChangeSignalClass.getField("name"); final Field fValue = propChangeSignalClass.getField("value"); @@ -148,28 +149,28 @@ import static net.scintill.ril_ofono.RilOfono.privStr; initProps(props, sourceObIface, sourceOb); } - /*package*/ static <T> T getProp(Map<String, Variant> props, String key, T defaultValue) { - //noinspection unchecked + @SuppressWarnings("unchecked") + /*package*/ static <T> T getProp(Map<String, Variant<?>> props, String key, T defaultValue) { return props.get(key) != null ? (T) props.get(key).getValue() : defaultValue; } - /*package*/ static <T> T[] getProp(Map<String, Variant> props, String key, @NonNull T[] defaultValue) { + + /*package*/ static <T> T[] getProp(Map<String, Variant<?>> props, String key, @NonNull T[] defaultValue) { if (props.get(key) != null) { - //noinspection unchecked - List<T> list = (List<T>)(props.get(key).getValue()); + @SuppressWarnings("unchecked") + List<T> list = (List<T>) props.get(key).getValue(); return list.toArray(defaultValue); } else { return defaultValue; } } - /*package*/ static String getProp(Map<String, Variant> props, String key, String defaultValue) { + /*package*/ static String getProp(Map<String, Variant<?>> props, String key, String defaultValue) { return props.get(key) != null ? props.get(key).getValue().toString() : defaultValue; } - /*package*/ static <T extends Enum> T getProp(Map<String, Variant> props, String key, T defaultValue) { - return (T) Enum.valueOf(defaultValue.getClass(), getProp(props, key, defaultValue.toString())); + /*package*/ static <T extends Enum<T>> T getProp(Map<String, Variant<?>> props, String key, T defaultValue) { + return Enum.valueOf(defaultValue.getDeclaringClass(), getProp(props, key, defaultValue.toString())); } - } diff --git a/src/java/net/scintill/ril_ofono/RilWrapper.java b/src/java/net/scintill/ril_ofono/RilWrapper.java index a2b441b..7013845 100644 --- a/src/java/net/scintill/ril_ofono/RilWrapper.java +++ b/src/java/net/scintill/ril_ofono/RilWrapper.java @@ -108,7 +108,7 @@ public final class RilWrapper extends BaseCommands { Field mField; DynamicRegistrantListFromField(String fieldname) { try { - mField = Utils.getField(RilWrapper.this, fieldname); + mField = Utils.getField(RilWrapper.class, fieldname); mField.setAccessible(true); } catch (NoSuchFieldException e) { throw new RuntimeException("unable to create dynamic registrant list from field "+fieldname, e); @@ -829,6 +829,7 @@ public final class RilWrapper extends BaseCommands { }); } + @Deprecated public void getLastPdpFailCause(final android.os.Message msg) { runOnDbusThread(new Runnable() { public void run() { @@ -914,6 +915,7 @@ public final class RilWrapper extends BaseCommands { }); } + @Deprecated public void getPDPContextList(final android.os.Message msg) { runOnDbusThread(new Runnable() { public void run() { @@ -1441,6 +1443,7 @@ public final class RilWrapper extends BaseCommands { }); } + @Deprecated public void requestIsimAuthentication(final String a, final android.os.Message msg) { runOnDbusThread(new Runnable() { public void run() { diff --git a/src/java/net/scintill/ril_ofono/SimFiles.java b/src/java/net/scintill/ril_ofono/SimFiles.java index 32a0118..e3f220a 100644 --- a/src/java/net/scintill/ril_ofono/SimFiles.java +++ b/src/java/net/scintill/ril_ofono/SimFiles.java @@ -39,8 +39,8 @@ import static net.scintill.ril_ofono.PropManager.getProp; private static final String TAG = "RilOfono"; - private final Map<String, Variant> mMsgWaitingProps; - private Map<String, Variant> mSimProps; + private final Map<String, Variant<?>> mMsgWaitingProps; + private Map<String, Variant<?>> mSimProps; private static final int COMMAND_GET_RESPONSE = 0xc0; private static final int COMMAND_READ_BINARY = 0xb0; @@ -52,7 +52,7 @@ import static net.scintill.ril_ofono.PropManager.getProp; private static final int ADN_FOOTER_SIZE = 14; - /*package*/ SimFiles(Map<String, Variant> simProps, Map<String, Variant> msgWaitingProps) { + /*package*/ SimFiles(Map<String, Variant<?>> simProps, Map<String, Variant<?>> msgWaitingProps) { mSimProps = simProps; mMsgWaitingProps = msgWaitingProps; } diff --git a/src/java/net/scintill/ril_ofono/SimModule.java b/src/java/net/scintill/ril_ofono/SimModule.java index 8559b64..ce84952 100644 --- a/src/java/net/scintill/ril_ofono/SimModule.java +++ b/src/java/net/scintill/ril_ofono/SimModule.java @@ -19,8 +19,6 @@ package net.scintill.ril_ofono; -import android.telephony.Rlog; - import com.android.internal.telephony.CommandException; import com.android.internal.telephony.uicc.IccCardApplicationStatus; import com.android.internal.telephony.uicc.IccCardStatus; @@ -44,11 +42,9 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; private RegistrantList mIccStatusChangedRegistrants; - private MessageWaiting mMsgWaiting; - private final Map<String, Variant> mMsgWaitingProps = new HashMap<>(); + private final Map<String, Variant<?>> mMsgWaitingProps = new HashMap<>(); - private SimManager mSim; - private final Map<String, Variant> mSimProps = new HashMap<>(); + private final Map<String, Variant<?>> mSimProps = new HashMap<>(); private final SimFiles mSimFiles = new SimFiles(mSimProps, mMsgWaitingProps); private static final String SIM_APP_ID = "00"; @@ -56,11 +52,11 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; /*package*/ SimModule(RegistrantList iccStatusChangedRegistrants) { mIccStatusChangedRegistrants = iccStatusChangedRegistrants; - mSim = RilOfono.sInstance.getOfonoInterface(SimManager.class); - mMsgWaiting = RilOfono.sInstance.getOfonoInterface(MessageWaiting.class); + SimManager sim = RilOfono.sInstance.getOfonoInterface(SimManager.class); + MessageWaiting msgWaiting = RilOfono.sInstance.getOfonoInterface(MessageWaiting.class); - mirrorProps(SimManager.class, mSim, SimManager.PropertyChanged.class, mSimProps); - mirrorProps(MessageWaiting.class, mMsgWaiting, MessageWaiting.PropertyChanged.class, mMsgWaitingProps); + mirrorProps(SimManager.class, sim, SimManager.PropertyChanged.class, mSimProps); + mirrorProps(MessageWaiting.class, msgWaiting, MessageWaiting.PropertyChanged.class, mMsgWaitingProps); } @RilMethod @@ -114,12 +110,12 @@ import static net.scintill.ril_ofono.RilOfono.runOnMainThreadDebounced; return new PrivResponseOb(cardStatus); } - protected void onPropChange(SimManager simManager, String name, Variant value) { + protected void onPropChange(SimManager simManager, String name, Variant<?> value) { // TODO check if something that we report actually changed? runOnMainThreadDebounced(mFnNotifySimChanged, 350); } - protected void onPropChange(MessageWaiting messageWaiting, String name, Variant value) { + protected void onPropChange(MessageWaiting messageWaiting, String name, Variant<?> value) { // no action needed other than mirroring props } diff --git a/src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java b/src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java index f72ce28..a920efd 100644 --- a/src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java +++ b/src/java/net/scintill/ril_ofono/SupplementaryServicesModule.java @@ -43,7 +43,7 @@ import static com.android.internal.telephony.CommandsInterface.USSD_MODE_NOT_SUP 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 - Pair<String, Variant> ussdResponse = mSupplSvcs.Initiate(ussdString); + Pair<String, Variant<?>> ussdResponse = mSupplSvcs.Initiate(ussdString); if (!ussdResponse.a.equals("USSD")) { RilOfono.notifyResultAndLog("ussd n/a", mUSSDRegistrants, new String[]{""+USSD_MODE_NOT_SUPPORTED, null}, false); } else { diff --git a/src/java/net/scintill/ril_ofono/Utils.java b/src/java/net/scintill/ril_ofono/Utils.java index 5808d50..246c51b 100644 --- a/src/java/net/scintill/ril_ofono/Utils.java +++ b/src/java/net/scintill/ril_ofono/Utils.java @@ -96,8 +96,8 @@ public abstract class Utils { return elements[3].getMethodName(); } - /*package*/ static Field getField(Object o, String fieldname) throws NoSuchFieldException { - for (Class cls = o.getClass(); cls.getSuperclass() != null; cls = cls.getSuperclass()) { + /*package*/ static Field getField(Class<?> cls, String fieldname) throws NoSuchFieldException { + for (; cls.getSuperclass() != null; cls = cls.getSuperclass()) { try { return cls.getDeclaredField(fieldname); } catch (NoSuchFieldException e) { |
