Loading Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ java_library { "android.hardware.radio.config-V1.0-java-shallow", "android.hardware.radio.config-V1.1-java-shallow", "android.hardware.radio.config-V1.2-java-shallow", "android.hardware.radio.config-V1.3-java-shallow", "android.hardware.radio.deprecated-V1.0-java-shallow", "ecc-protos-lite", "libphonenumber-nogeocoder", Loading src/java/com/android/internal/telephony/CellularNetworkValidator.java +1 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ public class CellularNetworkValidator { */ public boolean isValidationFeatureSupported() { return PhoneConfigurationManager.getInstance().getCurrentPhoneCapability() .validationBeforeSwitchSupported; .getPsDataConnectionLingerTimeMillis() > 0; } @VisibleForTesting Loading src/java/com/android/internal/telephony/PhoneConfigurationManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -306,7 +306,7 @@ public class PhoneConfigurationManager { } public int getNumberOfModemsWithSimultaneousDataConnections() { return mStaticCapability.maxActiveData; return mStaticCapability.getMaxActivePsVoice(); } private void notifyCapabilityChanged() { Loading @@ -321,7 +321,7 @@ public class PhoneConfigurationManager { */ public void switchMultiSimConfig(int numOfSims) { log("switchMultiSimConfig: with numOfSims = " + numOfSims); if (getStaticPhoneCapability().logicalModemList.size() < numOfSims) { if (getStaticPhoneCapability().getLogicalModemUuids().size() < numOfSims) { log("switchMultiSimConfig: Phone is not capable of enabling " + numOfSims + " sims, exiting!"); return; Loading src/java/com/android/internal/telephony/RadioConfig.java +63 −5 Original line number Diff line number Diff line Loading @@ -38,15 +38,19 @@ import android.os.Message; import android.os.Registrant; import android.os.RemoteException; import android.os.WorkSource; import android.telephony.PhoneCapability; import android.telephony.Rlog; import android.telephony.SimSlotCapability; import android.util.SparseArray; import com.android.internal.telephony.uicc.IccSlotStatus; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.NoSuchElementException; import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; /** * This class provides wrapper APIs for IRadioConfig interface. Loading @@ -64,6 +68,8 @@ public class RadioConfig extends Handler { private static final HalVersion RADIO_CONFIG_HAL_VERSION_1_1 = new HalVersion(1, 1); private static final HalVersion RADIO_CONFIG_HAL_VERSION_1_3 = new HalVersion(1, 3); private final boolean mIsMobileNetworkSupported; private volatile IRadioConfig mRadioConfigProxy = null; // IRadioConfig version Loading Loading @@ -340,6 +346,14 @@ public class RadioConfig extends Handler { logd(rr.serialString() + "> " + requestToString(rr.mRequest)); } if (mRadioConfigVersion.greaterOrEqual(RADIO_CONFIG_HAL_VERSION_1_3)) { try { ((android.hardware.radio.config.V1_3.IRadioConfig) mRadioConfigProxy) .getPhoneCapability_1_3(rr.mSerial); } catch (RemoteException | RuntimeException e) { resetProxyAndRequestList("getPhoneCapability_1_3", e); } } else { try { ((android.hardware.radio.config.V1_1.IRadioConfig) mRadioConfigProxy) .getPhoneCapability(rr.mSerial); Loading @@ -347,6 +361,7 @@ public class RadioConfig extends Handler { resetProxyAndRequestList("getPhoneCapability", e); } } } /** * @return whether current radio config version supports SET_PREFERRED_DATA_MODEM command. Loading Loading @@ -487,6 +502,49 @@ public class RadioConfig extends Handler { return response; } static PhoneCapability convertHalPhoneCapability( android.hardware.radio.config.V1_1.PhoneCapability pc) { long psDataConnectionLingerTimeMillis = pc.isInternetLingeringSupported ? 1 : 0; List<String> logicalModemUuids = new ArrayList<>(); for (android.hardware.radio.config.V1_1.ModemInfo modemInfo : pc.logicalModemList) { logicalModemUuids.add("com.xxxx.lm" + modemInfo.modemId); } List<List<Long>> features = new ArrayList<>(); for (int i = 0; i < pc.maxActiveData; i++) { List<Long> feature = new ArrayList<>(); feature.add(PhoneCapability.MODEM_FEATURE_PS_VOICE_REG); features.add(feature); } return new PhoneCapability(0, 0, 0, 0, psDataConnectionLingerTimeMillis, 0, null, null, null, null, logicalModemUuids, null, features); } static PhoneCapability convertHalPhoneCapability_1_3( android.hardware.radio.config.V1_3.PhoneCapability pc) { List<SimSlotCapability> simSlotCapabilities = new ArrayList<>(); for (android.hardware.radio.config.V1_3.SimSlotCapability sc : pc.simSlotCapabilities) { simSlotCapabilities.add(new SimSlotCapability(sc.physicalSlotId, sc.slotType)); } List<List<Long>> features = new ArrayList<>(); for (android.hardware.radio.config.V1_3.ConcurrentModemFeatures cmf : pc.concurrentFeatureSupport) { features.add(cmf.modemFeatures .stream() .mapToLong(Integer::longValue) .boxed() .collect(Collectors.toList())); } return new PhoneCapability(pc.utranUeCategoryDl, pc.utranUeCategoryUl, pc.eutranUeCategoryDl, pc.eutranUeCategoryUl, pc.psDataConnectionLingerTimeMillis, pc.supportedRats, pc.geranBands, pc.utranBands, pc.eutranBands, pc.ngranBands, pc.logicalModemUuids, simSlotCapabilities, features); } private static void logd(String log) { Rlog.d(TAG, log); } Loading src/java/com/android/internal/telephony/RadioConfigResponse.java +26 −20 Original line number Diff line number Diff line Loading @@ -20,14 +20,12 @@ import android.hardware.radio.V1_0.RadioError; import android.hardware.radio.V1_0.RadioResponseInfo; import android.hardware.radio.config.V1_1.ModemsConfig; import android.hardware.radio.config.V1_2.IRadioConfigResponse; import android.telephony.ModemInfo; import android.telephony.PhoneCapability; import android.telephony.Rlog; import com.android.internal.telephony.uicc.IccSlotStatus; import java.util.ArrayList; import java.util.List; /** * This class is the implementation of IRadioConfigResponse interface. Loading Loading @@ -115,23 +113,6 @@ public class RadioConfigResponse extends IRadioConfigResponse.Stub { } } private PhoneCapability convertHalPhoneCapability( android.hardware.radio.config.V1_1.PhoneCapability phoneCapability) { // TODO b/121394331: clean up V1_1.PhoneCapability fields. int maxActiveVoiceCalls = 0; int maxActiveData = phoneCapability.maxActiveData; int max5G = 0; boolean validationBeforeSwitchSupported = phoneCapability.isInternetLingeringSupported; List<ModemInfo> logicalModemList = new ArrayList(); for (android.hardware.radio.config.V1_1.ModemInfo modemInfo : phoneCapability.logicalModemList) { logicalModemList.add(new ModemInfo(modemInfo.modemId)); } return new PhoneCapability(maxActiveVoiceCalls, maxActiveData, max5G, logicalModemList, validationBeforeSwitchSupported); } /** * Response function for IRadioConfig.getPhoneCapability(). */ Loading @@ -140,7 +121,7 @@ public class RadioConfigResponse extends IRadioConfigResponse.Stub { RILRequest rr = mRadioConfig.processResponse(responseInfo); if (rr != null) { PhoneCapability ret = convertHalPhoneCapability(phoneCapability); PhoneCapability ret = RadioConfig.convertHalPhoneCapability(phoneCapability); if (responseInfo.error == RadioError.NONE) { // send response RadioResponse.sendMessageResponse(rr.mResult, ret); Loading @@ -157,6 +138,31 @@ public class RadioConfigResponse extends IRadioConfigResponse.Stub { } } /** * Response function for IRadioConfig.getPhoneCapability_1_3(). */ public void getPhoneCapabilityResponse_1_3(RadioResponseInfo responseInfo, android.hardware.radio.config.V1_3.PhoneCapability phoneCapability) { RILRequest rr = mRadioConfig.processResponse(responseInfo); if (rr != null) { PhoneCapability ret = RadioConfig.convertHalPhoneCapability_1_3(phoneCapability); if (responseInfo.error == RadioError.NONE) { // send response RadioResponse.sendMessageResponse(rr.mResult, ret); Rlog.d(TAG, rr.serialString() + "< " + mRadioConfig.requestToString(rr.mRequest) + " " + ret.toString()); } else { rr.onError(responseInfo.error, ret); Rlog.e(TAG, rr.serialString() + "< " + mRadioConfig.requestToString(rr.mRequest) + " error " + responseInfo.error); } } else { Rlog.e(TAG, "getPhoneCapabilityResponse_1_3: Error " + responseInfo.toString()); } } /** * Response function for IRadioConfig.setPreferredDataModem(). */ Loading Loading
Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ java_library { "android.hardware.radio.config-V1.0-java-shallow", "android.hardware.radio.config-V1.1-java-shallow", "android.hardware.radio.config-V1.2-java-shallow", "android.hardware.radio.config-V1.3-java-shallow", "android.hardware.radio.deprecated-V1.0-java-shallow", "ecc-protos-lite", "libphonenumber-nogeocoder", Loading
src/java/com/android/internal/telephony/CellularNetworkValidator.java +1 −1 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ public class CellularNetworkValidator { */ public boolean isValidationFeatureSupported() { return PhoneConfigurationManager.getInstance().getCurrentPhoneCapability() .validationBeforeSwitchSupported; .getPsDataConnectionLingerTimeMillis() > 0; } @VisibleForTesting Loading
src/java/com/android/internal/telephony/PhoneConfigurationManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -306,7 +306,7 @@ public class PhoneConfigurationManager { } public int getNumberOfModemsWithSimultaneousDataConnections() { return mStaticCapability.maxActiveData; return mStaticCapability.getMaxActivePsVoice(); } private void notifyCapabilityChanged() { Loading @@ -321,7 +321,7 @@ public class PhoneConfigurationManager { */ public void switchMultiSimConfig(int numOfSims) { log("switchMultiSimConfig: with numOfSims = " + numOfSims); if (getStaticPhoneCapability().logicalModemList.size() < numOfSims) { if (getStaticPhoneCapability().getLogicalModemUuids().size() < numOfSims) { log("switchMultiSimConfig: Phone is not capable of enabling " + numOfSims + " sims, exiting!"); return; Loading
src/java/com/android/internal/telephony/RadioConfig.java +63 −5 Original line number Diff line number Diff line Loading @@ -38,15 +38,19 @@ import android.os.Message; import android.os.Registrant; import android.os.RemoteException; import android.os.WorkSource; import android.telephony.PhoneCapability; import android.telephony.Rlog; import android.telephony.SimSlotCapability; import android.util.SparseArray; import com.android.internal.telephony.uicc.IccSlotStatus; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.NoSuchElementException; import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; /** * This class provides wrapper APIs for IRadioConfig interface. Loading @@ -64,6 +68,8 @@ public class RadioConfig extends Handler { private static final HalVersion RADIO_CONFIG_HAL_VERSION_1_1 = new HalVersion(1, 1); private static final HalVersion RADIO_CONFIG_HAL_VERSION_1_3 = new HalVersion(1, 3); private final boolean mIsMobileNetworkSupported; private volatile IRadioConfig mRadioConfigProxy = null; // IRadioConfig version Loading Loading @@ -340,6 +346,14 @@ public class RadioConfig extends Handler { logd(rr.serialString() + "> " + requestToString(rr.mRequest)); } if (mRadioConfigVersion.greaterOrEqual(RADIO_CONFIG_HAL_VERSION_1_3)) { try { ((android.hardware.radio.config.V1_3.IRadioConfig) mRadioConfigProxy) .getPhoneCapability_1_3(rr.mSerial); } catch (RemoteException | RuntimeException e) { resetProxyAndRequestList("getPhoneCapability_1_3", e); } } else { try { ((android.hardware.radio.config.V1_1.IRadioConfig) mRadioConfigProxy) .getPhoneCapability(rr.mSerial); Loading @@ -347,6 +361,7 @@ public class RadioConfig extends Handler { resetProxyAndRequestList("getPhoneCapability", e); } } } /** * @return whether current radio config version supports SET_PREFERRED_DATA_MODEM command. Loading Loading @@ -487,6 +502,49 @@ public class RadioConfig extends Handler { return response; } static PhoneCapability convertHalPhoneCapability( android.hardware.radio.config.V1_1.PhoneCapability pc) { long psDataConnectionLingerTimeMillis = pc.isInternetLingeringSupported ? 1 : 0; List<String> logicalModemUuids = new ArrayList<>(); for (android.hardware.radio.config.V1_1.ModemInfo modemInfo : pc.logicalModemList) { logicalModemUuids.add("com.xxxx.lm" + modemInfo.modemId); } List<List<Long>> features = new ArrayList<>(); for (int i = 0; i < pc.maxActiveData; i++) { List<Long> feature = new ArrayList<>(); feature.add(PhoneCapability.MODEM_FEATURE_PS_VOICE_REG); features.add(feature); } return new PhoneCapability(0, 0, 0, 0, psDataConnectionLingerTimeMillis, 0, null, null, null, null, logicalModemUuids, null, features); } static PhoneCapability convertHalPhoneCapability_1_3( android.hardware.radio.config.V1_3.PhoneCapability pc) { List<SimSlotCapability> simSlotCapabilities = new ArrayList<>(); for (android.hardware.radio.config.V1_3.SimSlotCapability sc : pc.simSlotCapabilities) { simSlotCapabilities.add(new SimSlotCapability(sc.physicalSlotId, sc.slotType)); } List<List<Long>> features = new ArrayList<>(); for (android.hardware.radio.config.V1_3.ConcurrentModemFeatures cmf : pc.concurrentFeatureSupport) { features.add(cmf.modemFeatures .stream() .mapToLong(Integer::longValue) .boxed() .collect(Collectors.toList())); } return new PhoneCapability(pc.utranUeCategoryDl, pc.utranUeCategoryUl, pc.eutranUeCategoryDl, pc.eutranUeCategoryUl, pc.psDataConnectionLingerTimeMillis, pc.supportedRats, pc.geranBands, pc.utranBands, pc.eutranBands, pc.ngranBands, pc.logicalModemUuids, simSlotCapabilities, features); } private static void logd(String log) { Rlog.d(TAG, log); } Loading
src/java/com/android/internal/telephony/RadioConfigResponse.java +26 −20 Original line number Diff line number Diff line Loading @@ -20,14 +20,12 @@ import android.hardware.radio.V1_0.RadioError; import android.hardware.radio.V1_0.RadioResponseInfo; import android.hardware.radio.config.V1_1.ModemsConfig; import android.hardware.radio.config.V1_2.IRadioConfigResponse; import android.telephony.ModemInfo; import android.telephony.PhoneCapability; import android.telephony.Rlog; import com.android.internal.telephony.uicc.IccSlotStatus; import java.util.ArrayList; import java.util.List; /** * This class is the implementation of IRadioConfigResponse interface. Loading Loading @@ -115,23 +113,6 @@ public class RadioConfigResponse extends IRadioConfigResponse.Stub { } } private PhoneCapability convertHalPhoneCapability( android.hardware.radio.config.V1_1.PhoneCapability phoneCapability) { // TODO b/121394331: clean up V1_1.PhoneCapability fields. int maxActiveVoiceCalls = 0; int maxActiveData = phoneCapability.maxActiveData; int max5G = 0; boolean validationBeforeSwitchSupported = phoneCapability.isInternetLingeringSupported; List<ModemInfo> logicalModemList = new ArrayList(); for (android.hardware.radio.config.V1_1.ModemInfo modemInfo : phoneCapability.logicalModemList) { logicalModemList.add(new ModemInfo(modemInfo.modemId)); } return new PhoneCapability(maxActiveVoiceCalls, maxActiveData, max5G, logicalModemList, validationBeforeSwitchSupported); } /** * Response function for IRadioConfig.getPhoneCapability(). */ Loading @@ -140,7 +121,7 @@ public class RadioConfigResponse extends IRadioConfigResponse.Stub { RILRequest rr = mRadioConfig.processResponse(responseInfo); if (rr != null) { PhoneCapability ret = convertHalPhoneCapability(phoneCapability); PhoneCapability ret = RadioConfig.convertHalPhoneCapability(phoneCapability); if (responseInfo.error == RadioError.NONE) { // send response RadioResponse.sendMessageResponse(rr.mResult, ret); Loading @@ -157,6 +138,31 @@ public class RadioConfigResponse extends IRadioConfigResponse.Stub { } } /** * Response function for IRadioConfig.getPhoneCapability_1_3(). */ public void getPhoneCapabilityResponse_1_3(RadioResponseInfo responseInfo, android.hardware.radio.config.V1_3.PhoneCapability phoneCapability) { RILRequest rr = mRadioConfig.processResponse(responseInfo); if (rr != null) { PhoneCapability ret = RadioConfig.convertHalPhoneCapability_1_3(phoneCapability); if (responseInfo.error == RadioError.NONE) { // send response RadioResponse.sendMessageResponse(rr.mResult, ret); Rlog.d(TAG, rr.serialString() + "< " + mRadioConfig.requestToString(rr.mRequest) + " " + ret.toString()); } else { rr.onError(responseInfo.error, ret); Rlog.e(TAG, rr.serialString() + "< " + mRadioConfig.requestToString(rr.mRequest) + " error " + responseInfo.error); } } else { Rlog.e(TAG, "getPhoneCapabilityResponse_1_3: Error " + responseInfo.toString()); } } /** * Response function for IRadioConfig.setPreferredDataModem(). */ Loading