Loading Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,12 @@ java_library { "android.hardware.radio-V1.4-java", "android.hardware.radio-V1.5-java", "android.hardware.radio-V1.6-java", "android.hardware.radio.data-V1-java", "android.hardware.radio.messaging-V1-java", "android.hardware.radio.modem-V1-java", "android.hardware.radio.network-V1-java", "android.hardware.radio.sim-V1-java", "android.hardware.radio.voice-V1-java", "voip-common", "ims-common", "unsupportedappusage", Loading src/java/com/android/internal/telephony/DataIndication.java 0 → 100644 +108 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.telephony; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_DATA_CALL_LIST_CHANGED; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_KEEPALIVE_STATUS; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_PCO_DATA; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_UNTHROTTLE_APN; import android.hardware.radio.data.IRadioDataIndication; import android.os.AsyncResult; import android.os.RemoteException; import android.telephony.PcoData; import android.telephony.data.DataCallResponse; import com.android.internal.telephony.dataconnection.KeepaliveStatus; import java.util.ArrayList; /** * Interface declaring unsolicited radio indications for data APIs. */ public class DataIndication extends IRadioDataIndication.Stub { RIL mRil; DataIndication(RIL ril) { mRil = ril; } /** * Indicates data call contexts have changed. * @param indicationType RadioIndicationType * @param dcList List of SetupDataCallResult identical to that returned by getDataCallList. * It is the complete list of current data contexts including new contexts that * have been activated. */ public void dataCallListChanged(int indicationType, android.hardware.radio.data.SetupDataCallResult[] dcList) { mRil.processIndication(indicationType); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_DATA_CALL_LIST_CHANGED, dcList); ArrayList<DataCallResponse> response = RILUtils.convertHalDataCallResultList(dcList); mRil.mDataCallListChangedRegistrants.notifyRegistrants( new AsyncResult(null, response, null)); } /** * Indicates a status update for an ongoing Keepalive session. * @param indicationType RadioIndicationType * @param halStatus Status of the ongoing Keepalive session */ public void keepaliveStatus(int indicationType, android.hardware.radio.data.KeepaliveStatus halStatus) { mRil.processIndication(indicationType); if (RIL.RILJ_LOGD) { mRil.unsljLogRet(RIL_UNSOL_KEEPALIVE_STATUS, "handle=" + halStatus.sessionHandle + " code=" + halStatus.code); } KeepaliveStatus ks = new KeepaliveStatus(halStatus.sessionHandle, halStatus.code); mRil.mNattKeepaliveStatusRegistrants.notifyRegistrants(new AsyncResult(null, ks, null)); } /** * Indicates when there is new Carrier PCO data received for a data call. * @param indicationType RadioIndicationType * @param pco New PcoData */ public void pcoData(int indicationType, android.hardware.radio.data.PcoDataInfo pco) { mRil.processIndication(indicationType); PcoData response = new PcoData(pco.cid, pco.bearerProto, pco.pcoId, pco.contents); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_PCO_DATA, response); mRil.mPcoDataRegistrants.notifyRegistrants(new AsyncResult(null, response, null)); } /** * Stop throttling calls to setupDataCall for the given APN. * @param indicationType RadioIndicationType * @param apn APN to unthrottle * @throws RemoteException */ public void unthrottleApn(int indicationType, String apn) throws RemoteException { mRil.processIndication(indicationType); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_UNTHROTTLE_APN, apn); mRil.mApnUnthrottledRegistrants.notifyRegistrants( new AsyncResult(null, apn, null)); } } src/java/com/android/internal/telephony/DataResponse.java 0 → 100644 +256 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.telephony; import android.hardware.radio.RadioError; import android.hardware.radio.RadioResponseInfo; import android.hardware.radio.data.IRadioDataResponse; import android.os.AsyncResult; import android.os.Message; import android.telephony.data.DataCallResponse; import android.telephony.data.SlicingConfig; import com.android.internal.telephony.dataconnection.KeepaliveStatus; import java.util.ArrayList; /** * Interface declaring response functions to solicited radio requests for data APIs. */ public class DataResponse extends IRadioDataResponse.Stub { private final RIL mRil; public DataResponse(RIL ril) { mRil = ril; } /** * Helper function to send response msg * @param msg Response message to be sent * @param ret Return object to be included in the response message */ private static void sendMessageResponse(Message msg, Object ret) { if (msg != null) { AsyncResult.forMessage(msg, ret, null); msg.sendToTarget(); } } private void responseVoid(RadioResponseInfo responseInfo) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { Object ret = null; if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, ret); } mRil.processResponseDone(rr, responseInfo, ret); } } /** * Acknowledge the receipt of radio request sent to the vendor. This must be sent only for * radio request which take long time to respond. * For more details, refer https://source.android.com/devices/tech/connect/ril.html * @param serial Serial no. of the request whose acknowledgement is sent. */ public void acknowledgeRequest(int serial) { mRil.processRequestAck(serial); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param id The pdu session id allocated */ public void allocatePduSessionIdResponse(RadioResponseInfo responseInfo, int id) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, id); } mRil.processResponseDone(rr, responseInfo, id); } } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void cancelHandoverResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void deactivateDataCallResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param dataCallResultList Response to get data call list as defined by setupDataCallResult in * types.hal */ public void getDataCallListResponse(RadioResponseInfo responseInfo, android.hardware.radio.data.SetupDataCallResult[] dataCallResultList) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { ArrayList<DataCallResponse> response = RILUtils.convertHalDataCallResultList(dataCallResultList); if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, response); } mRil.processResponseDone(rr, responseInfo, response); } } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param slicingConfig Current slicing configuration */ public void getSlicingConfigResponse(RadioResponseInfo responseInfo, android.hardware.radio.data.SlicingConfig slicingConfig) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { SlicingConfig ret = RILUtils.convertHalSlicingConfig(slicingConfig); if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, ret); } mRil.processResponseDone(rr, responseInfo, ret); } } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void releasePduSessionIdResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void setDataAllowedResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void setDataProfileResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void setDataThrottlingResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void setInitialAttachApnResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param setupDataCallResult Response to data call setup as defined by SetupDataCallResult */ public void setupDataCallResponse(RadioResponseInfo responseInfo, android.hardware.radio.data.SetupDataCallResult setupDataCallResult) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { DataCallResponse response = RILUtils.convertHalDataCallResult(setupDataCallResult); if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, response); } mRil.processResponseDone(rr, responseInfo, response); } } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void startHandoverResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param keepaliveStatus status of the keepalive with a handle for the session */ public void startKeepaliveResponse(RadioResponseInfo responseInfo, android.hardware.radio.data.KeepaliveStatus keepaliveStatus) { RILRequest rr = mRil.processResponse(responseInfo); if (rr == null) return; KeepaliveStatus ret = null; try { switch(responseInfo.error) { case RadioError.NONE: int convertedStatus = RILUtils.convertHalKeepaliveStatusCode( keepaliveStatus.code); if (convertedStatus < 0) { ret = new KeepaliveStatus(KeepaliveStatus.ERROR_UNSUPPORTED); } else { ret = new KeepaliveStatus(keepaliveStatus.sessionHandle, convertedStatus); } // If responseInfo.error is NONE, response function sends the response message // even if result is actually an error. sendMessageResponse(rr.mResult, ret); break; case RadioError.REQUEST_NOT_SUPPORTED: ret = new KeepaliveStatus(KeepaliveStatus.ERROR_UNSUPPORTED); break; case RadioError.NO_RESOURCES: ret = new KeepaliveStatus(KeepaliveStatus.ERROR_NO_RESOURCES); break; default: ret = new KeepaliveStatus(KeepaliveStatus.ERROR_UNKNOWN); break; } } finally { // If responseInfo.error != NONE, the processResponseDone sends the response message. mRil.processResponseDone(rr, responseInfo, ret); } } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void stopKeepaliveResponse(RadioResponseInfo responseInfo) { RILRequest rr = mRil.processResponse(responseInfo); if (rr == null) return; try { if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, null); } else { //TODO: Error code translation } } finally { mRil.processResponseDone(rr, responseInfo, null); } } } src/java/com/android/internal/telephony/OemHookIndication.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,13 +16,13 @@ package com.android.internal.telephony; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_OEM_HOOK_RAW; import android.hardware.radio.deprecated.V1_0.IOemHookIndication; import android.os.AsyncResult; import java.util.ArrayList; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_OEM_HOOK_RAW; /** * Class containing oem hook indication callbacks */ Loading @@ -40,7 +40,7 @@ public class OemHookIndication extends IOemHookIndication.Stub { public void oemHookRaw(int indicationType, ArrayList<Byte> data) { mRil.processIndication(indicationType); byte[] response = RIL.arrayListToPrimitiveArray(data); byte[] response = RILUtils.arrayListToPrimitiveArray(data); if (RIL.RILJ_LOGD) { mRil.unsljLogvRet(RIL_UNSOL_OEM_HOOK_RAW, com.android.internal.telephony.uicc.IccUtils.bytesToHexString(response)); Loading src/java/com/android/internal/telephony/OemHookResponse.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,9 +16,9 @@ package com.android.internal.telephony; import android.hardware.radio.deprecated.V1_0.IOemHookResponse; import android.hardware.radio.V1_0.RadioError; import android.hardware.radio.V1_0.RadioResponseInfo; import android.hardware.radio.deprecated.V1_0.IOemHookResponse; import java.util.ArrayList; Loading @@ -42,7 +42,7 @@ public class OemHookResponse extends IOemHookResponse.Stub { if (rr != null) { byte[] ret = null; if (responseInfo.error == RadioError.NONE) { ret = RIL.arrayListToPrimitiveArray(data); ret = RILUtils.arrayListToPrimitiveArray(data); RadioResponse.sendMessageResponse(rr.mResult, ret); } mRil.processResponseDone(rr, responseInfo, ret); Loading Loading
Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,12 @@ java_library { "android.hardware.radio-V1.4-java", "android.hardware.radio-V1.5-java", "android.hardware.radio-V1.6-java", "android.hardware.radio.data-V1-java", "android.hardware.radio.messaging-V1-java", "android.hardware.radio.modem-V1-java", "android.hardware.radio.network-V1-java", "android.hardware.radio.sim-V1-java", "android.hardware.radio.voice-V1-java", "voip-common", "ims-common", "unsupportedappusage", Loading
src/java/com/android/internal/telephony/DataIndication.java 0 → 100644 +108 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.telephony; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_DATA_CALL_LIST_CHANGED; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_KEEPALIVE_STATUS; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_PCO_DATA; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_UNTHROTTLE_APN; import android.hardware.radio.data.IRadioDataIndication; import android.os.AsyncResult; import android.os.RemoteException; import android.telephony.PcoData; import android.telephony.data.DataCallResponse; import com.android.internal.telephony.dataconnection.KeepaliveStatus; import java.util.ArrayList; /** * Interface declaring unsolicited radio indications for data APIs. */ public class DataIndication extends IRadioDataIndication.Stub { RIL mRil; DataIndication(RIL ril) { mRil = ril; } /** * Indicates data call contexts have changed. * @param indicationType RadioIndicationType * @param dcList List of SetupDataCallResult identical to that returned by getDataCallList. * It is the complete list of current data contexts including new contexts that * have been activated. */ public void dataCallListChanged(int indicationType, android.hardware.radio.data.SetupDataCallResult[] dcList) { mRil.processIndication(indicationType); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_DATA_CALL_LIST_CHANGED, dcList); ArrayList<DataCallResponse> response = RILUtils.convertHalDataCallResultList(dcList); mRil.mDataCallListChangedRegistrants.notifyRegistrants( new AsyncResult(null, response, null)); } /** * Indicates a status update for an ongoing Keepalive session. * @param indicationType RadioIndicationType * @param halStatus Status of the ongoing Keepalive session */ public void keepaliveStatus(int indicationType, android.hardware.radio.data.KeepaliveStatus halStatus) { mRil.processIndication(indicationType); if (RIL.RILJ_LOGD) { mRil.unsljLogRet(RIL_UNSOL_KEEPALIVE_STATUS, "handle=" + halStatus.sessionHandle + " code=" + halStatus.code); } KeepaliveStatus ks = new KeepaliveStatus(halStatus.sessionHandle, halStatus.code); mRil.mNattKeepaliveStatusRegistrants.notifyRegistrants(new AsyncResult(null, ks, null)); } /** * Indicates when there is new Carrier PCO data received for a data call. * @param indicationType RadioIndicationType * @param pco New PcoData */ public void pcoData(int indicationType, android.hardware.radio.data.PcoDataInfo pco) { mRil.processIndication(indicationType); PcoData response = new PcoData(pco.cid, pco.bearerProto, pco.pcoId, pco.contents); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_PCO_DATA, response); mRil.mPcoDataRegistrants.notifyRegistrants(new AsyncResult(null, response, null)); } /** * Stop throttling calls to setupDataCall for the given APN. * @param indicationType RadioIndicationType * @param apn APN to unthrottle * @throws RemoteException */ public void unthrottleApn(int indicationType, String apn) throws RemoteException { mRil.processIndication(indicationType); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_UNTHROTTLE_APN, apn); mRil.mApnUnthrottledRegistrants.notifyRegistrants( new AsyncResult(null, apn, null)); } }
src/java/com/android/internal/telephony/DataResponse.java 0 → 100644 +256 −0 Original line number Diff line number Diff line /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.telephony; import android.hardware.radio.RadioError; import android.hardware.radio.RadioResponseInfo; import android.hardware.radio.data.IRadioDataResponse; import android.os.AsyncResult; import android.os.Message; import android.telephony.data.DataCallResponse; import android.telephony.data.SlicingConfig; import com.android.internal.telephony.dataconnection.KeepaliveStatus; import java.util.ArrayList; /** * Interface declaring response functions to solicited radio requests for data APIs. */ public class DataResponse extends IRadioDataResponse.Stub { private final RIL mRil; public DataResponse(RIL ril) { mRil = ril; } /** * Helper function to send response msg * @param msg Response message to be sent * @param ret Return object to be included in the response message */ private static void sendMessageResponse(Message msg, Object ret) { if (msg != null) { AsyncResult.forMessage(msg, ret, null); msg.sendToTarget(); } } private void responseVoid(RadioResponseInfo responseInfo) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { Object ret = null; if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, ret); } mRil.processResponseDone(rr, responseInfo, ret); } } /** * Acknowledge the receipt of radio request sent to the vendor. This must be sent only for * radio request which take long time to respond. * For more details, refer https://source.android.com/devices/tech/connect/ril.html * @param serial Serial no. of the request whose acknowledgement is sent. */ public void acknowledgeRequest(int serial) { mRil.processRequestAck(serial); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param id The pdu session id allocated */ public void allocatePduSessionIdResponse(RadioResponseInfo responseInfo, int id) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, id); } mRil.processResponseDone(rr, responseInfo, id); } } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void cancelHandoverResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void deactivateDataCallResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param dataCallResultList Response to get data call list as defined by setupDataCallResult in * types.hal */ public void getDataCallListResponse(RadioResponseInfo responseInfo, android.hardware.radio.data.SetupDataCallResult[] dataCallResultList) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { ArrayList<DataCallResponse> response = RILUtils.convertHalDataCallResultList(dataCallResultList); if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, response); } mRil.processResponseDone(rr, responseInfo, response); } } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param slicingConfig Current slicing configuration */ public void getSlicingConfigResponse(RadioResponseInfo responseInfo, android.hardware.radio.data.SlicingConfig slicingConfig) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { SlicingConfig ret = RILUtils.convertHalSlicingConfig(slicingConfig); if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, ret); } mRil.processResponseDone(rr, responseInfo, ret); } } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void releasePduSessionIdResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void setDataAllowedResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void setDataProfileResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void setDataThrottlingResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void setInitialAttachApnResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param setupDataCallResult Response to data call setup as defined by SetupDataCallResult */ public void setupDataCallResponse(RadioResponseInfo responseInfo, android.hardware.radio.data.SetupDataCallResult setupDataCallResult) { RILRequest rr = mRil.processResponse(responseInfo); if (rr != null) { DataCallResponse response = RILUtils.convertHalDataCallResult(setupDataCallResult); if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, response); } mRil.processResponseDone(rr, responseInfo, response); } } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void startHandoverResponse(RadioResponseInfo responseInfo) { responseVoid(responseInfo); } /** * @param responseInfo Response info struct containing response type, serial no. and error * @param keepaliveStatus status of the keepalive with a handle for the session */ public void startKeepaliveResponse(RadioResponseInfo responseInfo, android.hardware.radio.data.KeepaliveStatus keepaliveStatus) { RILRequest rr = mRil.processResponse(responseInfo); if (rr == null) return; KeepaliveStatus ret = null; try { switch(responseInfo.error) { case RadioError.NONE: int convertedStatus = RILUtils.convertHalKeepaliveStatusCode( keepaliveStatus.code); if (convertedStatus < 0) { ret = new KeepaliveStatus(KeepaliveStatus.ERROR_UNSUPPORTED); } else { ret = new KeepaliveStatus(keepaliveStatus.sessionHandle, convertedStatus); } // If responseInfo.error is NONE, response function sends the response message // even if result is actually an error. sendMessageResponse(rr.mResult, ret); break; case RadioError.REQUEST_NOT_SUPPORTED: ret = new KeepaliveStatus(KeepaliveStatus.ERROR_UNSUPPORTED); break; case RadioError.NO_RESOURCES: ret = new KeepaliveStatus(KeepaliveStatus.ERROR_NO_RESOURCES); break; default: ret = new KeepaliveStatus(KeepaliveStatus.ERROR_UNKNOWN); break; } } finally { // If responseInfo.error != NONE, the processResponseDone sends the response message. mRil.processResponseDone(rr, responseInfo, ret); } } /** * @param responseInfo Response info struct containing response type, serial no. and error */ public void stopKeepaliveResponse(RadioResponseInfo responseInfo) { RILRequest rr = mRil.processResponse(responseInfo); if (rr == null) return; try { if (responseInfo.error == RadioError.NONE) { sendMessageResponse(rr.mResult, null); } else { //TODO: Error code translation } } finally { mRil.processResponseDone(rr, responseInfo, null); } } }
src/java/com/android/internal/telephony/OemHookIndication.java +3 −3 Original line number Diff line number Diff line Loading @@ -16,13 +16,13 @@ package com.android.internal.telephony; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_OEM_HOOK_RAW; import android.hardware.radio.deprecated.V1_0.IOemHookIndication; import android.os.AsyncResult; import java.util.ArrayList; import static com.android.internal.telephony.RILConstants.RIL_UNSOL_OEM_HOOK_RAW; /** * Class containing oem hook indication callbacks */ Loading @@ -40,7 +40,7 @@ public class OemHookIndication extends IOemHookIndication.Stub { public void oemHookRaw(int indicationType, ArrayList<Byte> data) { mRil.processIndication(indicationType); byte[] response = RIL.arrayListToPrimitiveArray(data); byte[] response = RILUtils.arrayListToPrimitiveArray(data); if (RIL.RILJ_LOGD) { mRil.unsljLogvRet(RIL_UNSOL_OEM_HOOK_RAW, com.android.internal.telephony.uicc.IccUtils.bytesToHexString(response)); Loading
src/java/com/android/internal/telephony/OemHookResponse.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,9 +16,9 @@ package com.android.internal.telephony; import android.hardware.radio.deprecated.V1_0.IOemHookResponse; import android.hardware.radio.V1_0.RadioError; import android.hardware.radio.V1_0.RadioResponseInfo; import android.hardware.radio.deprecated.V1_0.IOemHookResponse; import java.util.ArrayList; Loading @@ -42,7 +42,7 @@ public class OemHookResponse extends IOemHookResponse.Stub { if (rr != null) { byte[] ret = null; if (responseInfo.error == RadioError.NONE) { ret = RIL.arrayListToPrimitiveArray(data); ret = RILUtils.arrayListToPrimitiveArray(data); RadioResponse.sendMessageResponse(rr.mResult, ret); } mRil.processResponseDone(rr, responseInfo, ret); Loading