Loading src/java/com/android/internal/telephony/CommandsInterface.java +16 −0 Original line number Diff line number Diff line Loading @@ -2750,4 +2750,20 @@ public interface CommandsInterface { * @param h Handler to be removed from the registrant list. */ public void unregisterForSimPhonebookRecordsReceived(Handler h); /** * Set the UE's usage setting. * * @param result Callback message containing the success or failure status. * @param usageSetting the UE's usage setting, either VOICE_CENTRIC or DATA_CENTRIC. */ default void setUsageSetting(Message result, /* @TelephonyManager.UsageSetting */ int usageSetting) {} /** * Get the UE's usage setting. * * @param result Callback message containing the usage setting (or a failure status). */ default void getUsageSetting(Message result) {} } src/java/com/android/internal/telephony/NetworkResponse.java +16 −0 Original line number Diff line number Diff line Loading @@ -448,4 +448,20 @@ public class NetworkResponse extends IRadioNetworkResponse.Stub { int retriesRemaining) { RadioResponse.responseInts(mRil, responseInfo, retriesRemaining); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void setUsageSettingResponse(RadioResponseInfo responseInfo) { RadioResponse.responseVoid(mRil, responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param usageSetting the cellular usage setting */ public void getUsageSettingResponse(RadioResponseInfo responseInfo, /* @TelephonyManager.UsageSetting */ int usageSetting) { RadioResponse.responseInts(mRil, responseInfo, usageSetting); } } src/java/com/android/internal/telephony/RIL.java +70 −0 Original line number Diff line number Diff line Loading @@ -4971,6 +4971,76 @@ public class RIL extends BaseCommands implements CommandsInterface { } } /** * Set the UE's usage setting. * * @param result Callback message containing the success or failure status. * @param usageSetting the UE's usage setting, either VOICE_CENTRIC or DATA_CENTRIC. */ @Override public void setUsageSetting(Message result, /* @TelephonyManager.UsageSetting */ int usageSetting) { RadioNetworkProxy networkProxy = getRadioServiceProxy(RadioNetworkProxy.class, result); if (networkProxy.isEmpty()) return; if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_2_0)) { RILRequest rr = obtainRequest(RIL_REQUEST_SET_USAGE_SETTING, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + RILUtils.requestToString(rr.mRequest)); } try { networkProxy.setUsageSetting(rr.mSerial, usageSetting); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(NETWORK_SERVICE, "setUsageSetting", e); } } else { if (RILJ_LOGD) { Rlog.d(RILJ_LOG_TAG, "setUsageSetting: REQUEST_NOT_SUPPORTED"); } if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED)); result.sendToTarget(); } } } /** * Get the UE's usage setting. * * @param result Callback message containing the usage setting (or a failure status). */ @Override public void getUsageSetting(Message result) { RadioNetworkProxy networkProxy = getRadioServiceProxy(RadioNetworkProxy.class, result); if (networkProxy.isEmpty()) return; if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_2_0)) { RILRequest rr = obtainRequest(RIL_REQUEST_GET_USAGE_SETTING, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + RILUtils.requestToString(rr.mRequest)); } try { networkProxy.getUsageSetting(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(NETWORK_SERVICE, "getUsageSetting", e); } } else { if (RILJ_LOGD) { Rlog.d(RILJ_LOG_TAG, "getUsageSetting: REQUEST_NOT_SUPPORTED"); } if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED)); result.sendToTarget(); } } } //***** Private Methods /** * This is a helper function to be called when an indication callback is called for any radio Loading src/java/com/android/internal/telephony/RILUtils.java +6 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_SLOT_S import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_SMSC_ADDRESS; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_SYSTEM_SELECTION_CHANNELS; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_UICC_APPLICATIONS_ENABLEMENT; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_USAGE_SETTING; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GSM_BROADCAST_ACTIVATION; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GSM_GET_BROADCAST_CONFIG; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GSM_SET_BROADCAST_CONFIG; Loading Loading @@ -173,6 +174,7 @@ import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_TTY_MO import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_UICC_SUBSCRIPTION; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_USAGE_SETTING; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SHUTDOWN; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SIGNAL_STRENGTH; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SIM_AUTHENTICATION; Loading Loading @@ -4934,6 +4936,10 @@ public class RILUtils { return "ENABLE_VONR"; case RIL_REQUEST_IS_VONR_ENABLED: return "IS_VONR_ENABLED"; case RIL_REQUEST_SET_USAGE_SETTING: return "SET_USAGE_SETTING"; case RIL_REQUEST_GET_USAGE_SETTING: return "GET_USAGE_SETTING"; default: return "<unknown request " + request + ">"; } Loading src/java/com/android/internal/telephony/RadioNetworkProxy.java +27 −0 Original line number Diff line number Diff line Loading @@ -789,4 +789,31 @@ public class RadioNetworkProxy extends RadioServiceProxy { mRadioProxy.supplyNetworkDepersonalization(serial, netPin); } } /** * Call IRadioNetwork#getUsageSetting() * @param serial Serial number of request * @throws RemoteException */ public void getUsageSetting(int serial) throws RemoteException { if (isEmpty()) return; if (isAidl()) { mNetworkProxy.getUsageSetting(serial); } // Only supported on AIDL. } /** * Call IRadioNetwork#setUsageSetting() * @param serial Serial number of request * @throws RemoteException */ public void setUsageSetting(int serial, /* TelephonyManager.UsageSetting */ int usageSetting) throws RemoteException { if (isEmpty()) return; if (isAidl()) { mNetworkProxy.setUsageSetting(serial, usageSetting); } // Only supported on AIDL. } } Loading
src/java/com/android/internal/telephony/CommandsInterface.java +16 −0 Original line number Diff line number Diff line Loading @@ -2750,4 +2750,20 @@ public interface CommandsInterface { * @param h Handler to be removed from the registrant list. */ public void unregisterForSimPhonebookRecordsReceived(Handler h); /** * Set the UE's usage setting. * * @param result Callback message containing the success or failure status. * @param usageSetting the UE's usage setting, either VOICE_CENTRIC or DATA_CENTRIC. */ default void setUsageSetting(Message result, /* @TelephonyManager.UsageSetting */ int usageSetting) {} /** * Get the UE's usage setting. * * @param result Callback message containing the usage setting (or a failure status). */ default void getUsageSetting(Message result) {} }
src/java/com/android/internal/telephony/NetworkResponse.java +16 −0 Original line number Diff line number Diff line Loading @@ -448,4 +448,20 @@ public class NetworkResponse extends IRadioNetworkResponse.Stub { int retriesRemaining) { RadioResponse.responseInts(mRil, responseInfo, retriesRemaining); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void setUsageSettingResponse(RadioResponseInfo responseInfo) { RadioResponse.responseVoid(mRil, responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param usageSetting the cellular usage setting */ public void getUsageSettingResponse(RadioResponseInfo responseInfo, /* @TelephonyManager.UsageSetting */ int usageSetting) { RadioResponse.responseInts(mRil, responseInfo, usageSetting); } }
src/java/com/android/internal/telephony/RIL.java +70 −0 Original line number Diff line number Diff line Loading @@ -4971,6 +4971,76 @@ public class RIL extends BaseCommands implements CommandsInterface { } } /** * Set the UE's usage setting. * * @param result Callback message containing the success or failure status. * @param usageSetting the UE's usage setting, either VOICE_CENTRIC or DATA_CENTRIC. */ @Override public void setUsageSetting(Message result, /* @TelephonyManager.UsageSetting */ int usageSetting) { RadioNetworkProxy networkProxy = getRadioServiceProxy(RadioNetworkProxy.class, result); if (networkProxy.isEmpty()) return; if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_2_0)) { RILRequest rr = obtainRequest(RIL_REQUEST_SET_USAGE_SETTING, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + RILUtils.requestToString(rr.mRequest)); } try { networkProxy.setUsageSetting(rr.mSerial, usageSetting); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(NETWORK_SERVICE, "setUsageSetting", e); } } else { if (RILJ_LOGD) { Rlog.d(RILJ_LOG_TAG, "setUsageSetting: REQUEST_NOT_SUPPORTED"); } if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED)); result.sendToTarget(); } } } /** * Get the UE's usage setting. * * @param result Callback message containing the usage setting (or a failure status). */ @Override public void getUsageSetting(Message result) { RadioNetworkProxy networkProxy = getRadioServiceProxy(RadioNetworkProxy.class, result); if (networkProxy.isEmpty()) return; if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_2_0)) { RILRequest rr = obtainRequest(RIL_REQUEST_GET_USAGE_SETTING, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + RILUtils.requestToString(rr.mRequest)); } try { networkProxy.getUsageSetting(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(NETWORK_SERVICE, "getUsageSetting", e); } } else { if (RILJ_LOGD) { Rlog.d(RILJ_LOG_TAG, "getUsageSetting: REQUEST_NOT_SUPPORTED"); } if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED)); result.sendToTarget(); } } } //***** Private Methods /** * This is a helper function to be called when an indication callback is called for any radio Loading
src/java/com/android/internal/telephony/RILUtils.java +6 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,7 @@ import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_SLOT_S import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_SMSC_ADDRESS; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_SYSTEM_SELECTION_CHANNELS; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_UICC_APPLICATIONS_ENABLEMENT; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GET_USAGE_SETTING; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GSM_BROADCAST_ACTIVATION; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GSM_GET_BROADCAST_CONFIG; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_GSM_SET_BROADCAST_CONFIG; Loading Loading @@ -173,6 +174,7 @@ import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_TTY_MO import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_UICC_SUBSCRIPTION; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SET_USAGE_SETTING; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SHUTDOWN; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SIGNAL_STRENGTH; import static com.android.internal.telephony.RILConstants.RIL_REQUEST_SIM_AUTHENTICATION; Loading Loading @@ -4934,6 +4936,10 @@ public class RILUtils { return "ENABLE_VONR"; case RIL_REQUEST_IS_VONR_ENABLED: return "IS_VONR_ENABLED"; case RIL_REQUEST_SET_USAGE_SETTING: return "SET_USAGE_SETTING"; case RIL_REQUEST_GET_USAGE_SETTING: return "GET_USAGE_SETTING"; default: return "<unknown request " + request + ">"; } Loading
src/java/com/android/internal/telephony/RadioNetworkProxy.java +27 −0 Original line number Diff line number Diff line Loading @@ -789,4 +789,31 @@ public class RadioNetworkProxy extends RadioServiceProxy { mRadioProxy.supplyNetworkDepersonalization(serial, netPin); } } /** * Call IRadioNetwork#getUsageSetting() * @param serial Serial number of request * @throws RemoteException */ public void getUsageSetting(int serial) throws RemoteException { if (isEmpty()) return; if (isAidl()) { mNetworkProxy.getUsageSetting(serial); } // Only supported on AIDL. } /** * Call IRadioNetwork#setUsageSetting() * @param serial Serial number of request * @throws RemoteException */ public void setUsageSetting(int serial, /* TelephonyManager.UsageSetting */ int usageSetting) throws RemoteException { if (isEmpty()) return; if (isAidl()) { mNetworkProxy.setUsageSetting(serial, usageSetting); } // Only supported on AIDL. } }