Loading src/java/com/android/internal/telephony/RIL.java +29 −10 Original line number Diff line number Diff line Loading @@ -2452,11 +2452,22 @@ public class RIL extends BaseCommands implements CommandsInterface { mPreferredNetworkType = networkType; mMetrics.writeSetPreferredNetworkType(mPhoneId, networkType); if (mRadioVersion.lessOrEqual(RADIO_HAL_VERSION_1_3)) { try { radioProxy.setPreferredNetworkType(rr.mSerial, networkType); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "setPreferredNetworkType", e); } } else if (mRadioVersion.equals(RADIO_HAL_VERSION_1_4)) { android.hardware.radio.V1_4.IRadio radioProxy14 = (android.hardware.radio.V1_4.IRadio) radioProxy; try { radioProxy14.setPreferredNetworkTypeBitmap( rr.mSerial, RadioAccessFamily.getRafFromNetworkType(networkType)); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "setPreferredNetworkTypeBitmap", e); } } } } Loading @@ -2466,14 +2477,22 @@ public class RIL extends BaseCommands implements CommandsInterface { if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE, result, mRILDefaultWorkSource); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); if (mRadioVersion.lessOrEqual(RADIO_HAL_VERSION_1_3)) { try { radioProxy.getPreferredNetworkType(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getPreferredNetworkType", e); } } else if (mRadioVersion.equals(RADIO_HAL_VERSION_1_4)) { android.hardware.radio.V1_4.IRadio radioProxy14 = (android.hardware.radio.V1_4.IRadio) radioProxy; try { radioProxy14.getPreferredNetworkTypeBitmap(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getPreferredNetworkTypeBitmap", e); } } } } Loading src/java/com/android/internal/telephony/RadioResponse.java +22 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.telephony.CellInfo; import android.telephony.ModemActivityInfo; import android.telephony.NeighboringCellInfo; import android.telephony.PhoneNumberUtils; import android.telephony.RadioAccessFamily; import android.telephony.SignalStrength; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; Loading Loading @@ -726,6 +727,14 @@ public class RadioResponse extends IRadioResponse.Stub { responseVoid(responseInfo); } /** * Callback of setPreferredNetworkTypeBitmap defined in IRadio.hal. * @param responseInfo Response info struct containing response type, serial no. and error */ public void setPreferredNetworkTypeBitmapResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * * @param responseInfo Response info struct containing response type, serial no. and error Loading @@ -736,6 +745,19 @@ public class RadioResponse extends IRadioResponse.Stub { responseInts(responseInfo, nwType); } /** * Callback of the getPreferredNetworkTypeBitmap defined in the IRadio.hal. * @param responseInfo Response info struct containing response type, serial no. and error * @param networkTypeBitmap a 32-bit bitmap of * {@link android.telephony.TelephonyManager.NetworkTypeBitMask}. */ public void getPreferredNetworkTypeBitmapResponse( RadioResponseInfo responseInfo, int networkTypeBitmap) { int networkType = RadioAccessFamily.getNetworkTypeFromRaf(networkTypeBitmap); mRil.mPreferredNetworkType = networkType; responseInts(responseInfo, networkType); } /** * * @param responseInfo Response info struct containing response type, serial no. and error Loading Loading
src/java/com/android/internal/telephony/RIL.java +29 −10 Original line number Diff line number Diff line Loading @@ -2452,11 +2452,22 @@ public class RIL extends BaseCommands implements CommandsInterface { mPreferredNetworkType = networkType; mMetrics.writeSetPreferredNetworkType(mPhoneId, networkType); if (mRadioVersion.lessOrEqual(RADIO_HAL_VERSION_1_3)) { try { radioProxy.setPreferredNetworkType(rr.mSerial, networkType); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "setPreferredNetworkType", e); } } else if (mRadioVersion.equals(RADIO_HAL_VERSION_1_4)) { android.hardware.radio.V1_4.IRadio radioProxy14 = (android.hardware.radio.V1_4.IRadio) radioProxy; try { radioProxy14.setPreferredNetworkTypeBitmap( rr.mSerial, RadioAccessFamily.getRafFromNetworkType(networkType)); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "setPreferredNetworkTypeBitmap", e); } } } } Loading @@ -2466,14 +2477,22 @@ public class RIL extends BaseCommands implements CommandsInterface { if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE, result, mRILDefaultWorkSource); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); if (mRadioVersion.lessOrEqual(RADIO_HAL_VERSION_1_3)) { try { radioProxy.getPreferredNetworkType(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getPreferredNetworkType", e); } } else if (mRadioVersion.equals(RADIO_HAL_VERSION_1_4)) { android.hardware.radio.V1_4.IRadio radioProxy14 = (android.hardware.radio.V1_4.IRadio) radioProxy; try { radioProxy14.getPreferredNetworkTypeBitmap(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getPreferredNetworkTypeBitmap", e); } } } } Loading
src/java/com/android/internal/telephony/RadioResponse.java +22 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.telephony.CellInfo; import android.telephony.ModemActivityInfo; import android.telephony.NeighboringCellInfo; import android.telephony.PhoneNumberUtils; import android.telephony.RadioAccessFamily; import android.telephony.SignalStrength; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; Loading Loading @@ -726,6 +727,14 @@ public class RadioResponse extends IRadioResponse.Stub { responseVoid(responseInfo); } /** * Callback of setPreferredNetworkTypeBitmap defined in IRadio.hal. * @param responseInfo Response info struct containing response type, serial no. and error */ public void setPreferredNetworkTypeBitmapResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * * @param responseInfo Response info struct containing response type, serial no. and error Loading @@ -736,6 +745,19 @@ public class RadioResponse extends IRadioResponse.Stub { responseInts(responseInfo, nwType); } /** * Callback of the getPreferredNetworkTypeBitmap defined in the IRadio.hal. * @param responseInfo Response info struct containing response type, serial no. and error * @param networkTypeBitmap a 32-bit bitmap of * {@link android.telephony.TelephonyManager.NetworkTypeBitMask}. */ public void getPreferredNetworkTypeBitmapResponse( RadioResponseInfo responseInfo, int networkTypeBitmap) { int networkType = RadioAccessFamily.getNetworkTypeFromRaf(networkTypeBitmap); mRil.mPreferredNetworkType = networkType; responseInts(responseInfo, networkType); } /** * * @param responseInfo Response info struct containing response type, serial no. and error Loading