Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -383,7 +383,7 @@ public class GsmCdmaPhone extends Phone { @Override @Override protected void finalize() { protected void finalize() { if(DBG) logd("GsmCdmaPhone finalized"); if(DBG) logd("GsmCdmaPhone finalized"); if (mWakeLock.isHeld()) { if (mWakeLock != null && mWakeLock.isHeld()) { Rlog.e(LOG_TAG, "UNEXPECTED; mWakeLock is held when finalizing."); Rlog.e(LOG_TAG, "UNEXPECTED; mWakeLock is held when finalizing."); mWakeLock.release(); mWakeLock.release(); } } Loading src/java/com/android/internal/telephony/RIL.java +201 −90 Original line number Original line Diff line number Diff line Loading @@ -1384,14 +1384,20 @@ public final class RIL extends BaseCommands implements CommandsInterface { } } @Override @Override public void public void getSignalStrength(Message result) { getSignalStrength (Message result) { IRadio radioProxy = getRadioProxy(result); RILRequest rr if (radioProxy != null) { = RILRequest.obtain(RIL_REQUEST_SIGNAL_STRENGTH, result, mRILDefaultWorkSource); RILRequest rr = obtainRequest(RIL_REQUEST_SIGNAL_STRENGTH, result, mRILDefaultWorkSource); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); send(rr); try { radioProxy.getSignalStrength(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getSignalStrength", e); } } } } @Override @Override Loading Loading @@ -1537,10 +1543,34 @@ public final class RIL extends BaseCommands implements CommandsInterface { } } @Override @Override public void public void setupDataCall(int radioTechnology, int profile, String apn, setupDataCall(int radioTechnology, int profile, String apn, String user, String password, int authType, String protocol, String user, String password, int authType, String protocol, Message result) { Message result) { /* todo: hidlize IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_SETUP_DATA_CALL, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " radioTechnology = " + radioTechnology + " profile = " + profile + " apn = " + apn + " user = " + user + " password = " + password + " authType = " + authType + " protocol = " + protocol); } try { radioProxy.setupDataCall(rr.mSerial, radioTechnology + 2, profile, convertNullToEmptyString(apn), convertNullToEmptyString(user), convertNullToEmptyString(password), authType, convertNullToEmptyString(protocol)); mMetrics.writeRilSetupDataCall(mPhoneId, rr.mSerial, radioTechnology, profile, apn, authType, protocol); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "setupDataCall", e); } } */ RILRequest rr RILRequest rr = RILRequest.obtain(RIL_REQUEST_SETUP_DATA_CALL, result, mRILDefaultWorkSource); = RILRequest.obtain(RIL_REQUEST_SETUP_DATA_CALL, result, mRILDefaultWorkSource); Loading Loading @@ -2147,12 +2177,19 @@ public final class RIL extends BaseCommands implements CommandsInterface { @Override @Override public void getDataCallList(Message result) { public void getDataCallList(Message result) { RILRequest rr = RILRequest.obtain(RIL_REQUEST_DATA_CALL_LIST, result, IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_DATA_CALL_LIST, result, mRILDefaultWorkSource); mRILDefaultWorkSource); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); send(rr); try { radioProxy.getDataCallList(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getDataCallList", e); } } } } @Override @Override Loading Loading @@ -3119,11 +3156,21 @@ public final class RIL extends BaseCommands implements CommandsInterface { @Override @Override public void getCellInfoList(Message result, WorkSource workSource) { public void getCellInfoList(Message result, WorkSource workSource) { workSource = getDeafultWorkSourceIfInvalid(workSource); workSource = getDeafultWorkSourceIfInvalid(workSource); IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_GET_CELL_INFO_LIST, result, workSource); RILRequest rr = RILRequest.obtain(RIL_REQUEST_GET_CELL_INFO_LIST, result, workSource); if (RILJ_LOGD) { if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } send(rr); try { radioProxy.getCellInfoList(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getCellInfoList", e); } } } } @Override @Override Loading Loading @@ -3518,12 +3565,20 @@ public final class RIL extends BaseCommands implements CommandsInterface { @Override @Override public void public void getHardwareConfig (Message result) { getHardwareConfig (Message result) { RILRequest rr = RILRequest.obtain(RIL_REQUEST_GET_HARDWARE_CONFIG, result, IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_GET_HARDWARE_CONFIG, result, mRILDefaultWorkSource); mRILDefaultWorkSource); // Do not log function args for privacy if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); send(rr); try { radioProxy.getHardwareConfig(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getHardwareConfig", e); } } } } @Override @Override Loading Loading @@ -3627,32 +3682,50 @@ public final class RIL extends BaseCommands implements CommandsInterface { @Override @Override public void getRadioCapability(Message response) { public void getRadioCapability(Message response) { RILRequest rr = RILRequest.obtain( IRadio radioProxy = getRadioProxy(response); RIL_REQUEST_GET_RADIO_CAPABILITY, response, mRILDefaultWorkSource); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_GET_RADIO_CAPABILITY, response, mRILDefaultWorkSource); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } send(rr); try { radioProxy.getRadioCapability(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getRadioCapability", e); } } } } @Override @Override public void setRadioCapability(RadioCapability rc, Message response) { public void setRadioCapability(RadioCapability rc, Message response) { RILRequest rr = RILRequest.obtain( IRadio radioProxy = getRadioProxy(response); RIL_REQUEST_SET_RADIO_CAPABILITY, response, mRILDefaultWorkSource); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_SET_RADIO_CAPABILITY, response, rr.mParcel.writeInt(rc.getVersion()); mRILDefaultWorkSource); rr.mParcel.writeInt(rc.getSession()); rr.mParcel.writeInt(rc.getPhase()); rr.mParcel.writeInt(rc.getRadioAccessFamily()); rr.mParcel.writeString(rc.getLogicalModemUuid()); rr.mParcel.writeInt(rc.getStatus()); if (RILJ_LOGD) { if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + rc.toString()); + " RadioCapability = " + rc.toString()); } } send(rr); android.hardware.radio.V1_0.RadioCapability halRc = new android.hardware.radio.V1_0.RadioCapability(); halRc.session = rc.getSession(); halRc.phase = rc.getPhase(); halRc.raf = rc.getRadioAccessFamily(); halRc.logicalModemUuid = convertNullToEmptyString(rc.getLogicalModemUuid()); halRc.status = rc.getStatus(); try { radioProxy.setRadioCapability(rr.mSerial, halRc); } catch (Exception e) { handleRadioProxyExceptionForRR(rr, "setRadioCapability", e); } } } } @Override @Override Loading Loading @@ -3696,12 +3769,21 @@ public final class RIL extends BaseCommands implements CommandsInterface { @Override @Override public void pullLceData(Message response) { public void pullLceData(Message response) { RILRequest rr = RILRequest.obtain(RIL_REQUEST_PULL_LCEDATA, response, IRadio radioProxy = getRadioProxy(response); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_PULL_LCEDATA, response, mRILDefaultWorkSource); mRILDefaultWorkSource); if (RILJ_LOGD) { if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } } send(rr); try { radioProxy.pullLceData(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "pullLceData", e); } } } } @Override @Override Loading Loading @@ -3973,7 +4055,24 @@ public final class RIL extends BaseCommands implements CommandsInterface { int error = responseInfo.error; int error = responseInfo.error; int type = responseInfo.type; int type = responseInfo.type; RILRequest rr = findAndRemoveRequestFromList(serial); RILRequest rr = null; if (type == RadioResponseType.SOLICITED_ACK) { synchronized (mRequestList) { rr = mRequestList.get(serial); } if (rr == null) { Rlog.w(RILJ_LOG_TAG, "Unexpected solicited ack response! sn: " + serial); } else { decrementWakeLock(rr); if (RILJ_LOGD) { riljLog(rr.serialString() + " Ack < " + requestToString(rr.mRequest)); } } return rr; } rr = findAndRemoveRequestFromList(serial); if (rr == null) { if (rr == null) { Rlog.e(RIL.RILJ_LOG_TAG, "processResponse: Unexpected response! serial: " + serial Rlog.e(RIL.RILJ_LOG_TAG, "processResponse: Unexpected response! serial: " + serial + " error: " + error); + " error: " + error); Loading Loading @@ -4366,7 +4465,6 @@ public final class RIL extends BaseCommands implements CommandsInterface { } } } } Object ret = null; Object ret = null; if (error == 0 || p.dataAvail() > 0) { if (error == 0 || p.dataAvail() > 0) { Loading @@ -4377,25 +4475,15 @@ public final class RIL extends BaseCommands implements CommandsInterface { // will be using same code as unsolicited ril commands which will be done in // will be using same code as unsolicited ril commands which will be done in // separate CL. Other RIL commands below are deprecated and require framework // separate CL. Other RIL commands below are deprecated and require framework // code to be modified to remove them completely. // code to be modified to remove them completely. case RIL_REQUEST_SIGNAL_STRENGTH: ret = responseSignalStrength(p); break; case RIL_REQUEST_SETUP_DATA_CALL: ret = responseSetupDataCall(p); break; case RIL_REQUEST_SETUP_DATA_CALL: ret = responseSetupDataCall(p); break; case RIL_REQUEST_GET_IMEI: ret = responseString(p); break; case RIL_REQUEST_GET_IMEI: ret = responseString(p); break; case RIL_REQUEST_GET_IMEISV: ret = responseString(p); break; case RIL_REQUEST_GET_IMEISV: ret = responseString(p); break; case RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE: ret = responseInts(p); break; case RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE: ret = responseInts(p); break; case RIL_REQUEST_DATA_CALL_LIST: ret = responseDataCallList(p); break; case RIL_REQUEST_RESET_RADIO: ret = responseVoid(p); break; case RIL_REQUEST_RESET_RADIO: ret = responseVoid(p); break; case RIL_REQUEST_OEM_HOOK_RAW: ret = responseRaw(p); break; case RIL_REQUEST_OEM_HOOK_RAW: ret = responseRaw(p); break; case RIL_REQUEST_STK_GET_PROFILE: ret = responseString(p); break; case RIL_REQUEST_STK_SET_PROFILE: ret = responseVoid(p); break; case RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY: ret = responseVoid(p); break; case RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING: ret = responseVoid(p); break; case RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING: ret = responseVoid(p); break; case RIL_REQUEST_GET_CELL_INFO_LIST: ret = responseCellInfoList(p); break; case RIL_REQUEST_SET_INITIAL_ATTACH_APN: ret = responseVoid(p); break; case RIL_REQUEST_SET_INITIAL_ATTACH_APN: ret = responseVoid(p); break; case RIL_REQUEST_SET_DATA_PROFILE: ret = responseVoid(p); break; case RIL_REQUEST_SET_DATA_PROFILE: ret = responseVoid(p); break; case RIL_REQUEST_GET_HARDWARE_CONFIG: ret = responseHardwareConfig(p); break; case RIL_REQUEST_GET_RADIO_CAPABILITY: ret = responseRadioCapability(p); break; case RIL_REQUEST_SET_RADIO_CAPABILITY: ret = responseRadioCapability(p); break; case RIL_REQUEST_PULL_LCEDATA: ret = responseLceData(p); break; default: default: throw new RuntimeException("Unrecognized solicited response: " throw new RuntimeException("Unrecognized solicited response: " + rr.mRequest); + rr.mRequest); Loading Loading @@ -4474,7 +4562,7 @@ public final class RIL extends BaseCommands implements CommandsInterface { return rr; return rr; } } private RadioCapability makeStaticRadioCapability() { RadioCapability makeStaticRadioCapability() { // default to UNKNOWN so we fail fast. // default to UNKNOWN so we fail fast. int raf = RadioAccessFamily.RAF_UNKNOWN; int raf = RadioAccessFamily.RAF_UNKNOWN; Loading Loading @@ -5440,9 +5528,7 @@ public final class RIL extends BaseCommands implements CommandsInterface { return ret; return ret; } } static ArrayList<DataCallResponse> convertHalDcList(ArrayList<SetupDataCallResult> dcList) { static DataCallResponse convertHalDc(SetupDataCallResult dc) { ArrayList<DataCallResponse> dcResponseList = new ArrayList<>(dcList.size()); for (SetupDataCallResult dc : dcList) { DataCallResponse dcResponse = new DataCallResponse(); DataCallResponse dcResponse = new DataCallResponse(); // todo: get rid of this version field? // todo: get rid of this version field? // todo: create a DataCallResponse constructor that takes in these fields to make sure // todo: create a DataCallResponse constructor that takes in these fields to make sure Loading Loading @@ -5476,6 +5562,13 @@ public final class RIL extends BaseCommands implements CommandsInterface { } } dcResponse.mtu = dc.mtu; dcResponse.mtu = dc.mtu; return dcResponse; } static ArrayList<DataCallResponse> convertHalDcList(ArrayList<SetupDataCallResult> dcList) { ArrayList<DataCallResponse> dcResponseList = new ArrayList<>(dcList.size()); for (SetupDataCallResult dc : dcList) { DataCallResponse dcResponse = convertHalDc(dc); dcResponseList.add(dcResponse); dcResponseList.add(dcResponse); } } return dcResponseList; return dcResponseList; Loading Loading @@ -5556,7 +5649,7 @@ public final class RIL extends BaseCommands implements CommandsInterface { return capacityResponse; return capacityResponse; } } static ArrayList<CellInfo> responseCellInfoList( static ArrayList<CellInfo> convertHalCellInfoList( ArrayList<android.hardware.radio.V1_0.CellInfo> records) { ArrayList<android.hardware.radio.V1_0.CellInfo> records) { ArrayList<CellInfo> response = new ArrayList<CellInfo>(records.size()); ArrayList<CellInfo> response = new ArrayList<CellInfo>(records.size()); Loading Loading @@ -5637,4 +5730,22 @@ public final class RIL extends BaseCommands implements CommandsInterface { return response; return response; } } static SignalStrength convertHalSignalStrength( android.hardware.radio.V1_0.SignalStrength signalStrength) { return new SignalStrength(signalStrength.gw.signalStrength, signalStrength.gw.bitErrorRate, signalStrength.cdma.dbm, signalStrength.cdma.ecio, signalStrength.evdo.dbm, signalStrength.evdo.ecio, signalStrength.evdo.signalNoiseRatio, signalStrength.lte.signalStrength, signalStrength.lte.rsrp, signalStrength.lte.rsrq, signalStrength.lte.rssnr, signalStrength.lte.cqi, signalStrength.tdScdma.rscp, false /* gsmFlag - don't care; will be changed by SST */); } } } src/java/com/android/internal/telephony/RadioIndication.java +2 −16 Original line number Original line Diff line number Diff line Loading @@ -219,21 +219,7 @@ public class RadioIndication extends IRadioIndication.Stub { android.hardware.radio.V1_0.SignalStrength signalStrength) { android.hardware.radio.V1_0.SignalStrength signalStrength) { mRil.processIndication(indicationType); mRil.processIndication(indicationType); SignalStrength ss = new SignalStrength(signalStrength.gw.signalStrength, SignalStrength ss = RIL.convertHalSignalStrength(signalStrength); signalStrength.gw.bitErrorRate, signalStrength.cdma.dbm, signalStrength.cdma.ecio, signalStrength.evdo.dbm, signalStrength.evdo.ecio, signalStrength.evdo.signalNoiseRatio, signalStrength.lte.signalStrength, signalStrength.lte.rsrp, signalStrength.lte.rsrq, signalStrength.lte.rssnr, signalStrength.lte.cqi, signalStrength.tdScdma.rscp, false /* gsmFlag - don't care; will be changed by SST */); // Note this is set to "verbose" because it happens frequently // Note this is set to "verbose" because it happens frequently if (RIL.RILJ_LOGV) mRil.unsljLogvRet(RIL_UNSOL_SIGNAL_STRENGTH, ss); if (RIL.RILJ_LOGV) mRil.unsljLogvRet(RIL_UNSOL_SIGNAL_STRENGTH, ss); Loading Loading @@ -649,7 +635,7 @@ public class RadioIndication extends IRadioIndication.Stub { ArrayList<android.hardware.radio.V1_0.CellInfo> records) { ArrayList<android.hardware.radio.V1_0.CellInfo> records) { mRil.processIndication(indicationType); mRil.processIndication(indicationType); ArrayList<CellInfo> response = RIL.responseCellInfoList(records); ArrayList<CellInfo> response = RIL.convertHalCellInfoList(records); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CELL_INFO_LIST, response); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CELL_INFO_LIST, response); Loading src/java/com/android/internal/telephony/RadioResponse.java +154 −9 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -383,7 +383,7 @@ public class GsmCdmaPhone extends Phone { @Override @Override protected void finalize() { protected void finalize() { if(DBG) logd("GsmCdmaPhone finalized"); if(DBG) logd("GsmCdmaPhone finalized"); if (mWakeLock.isHeld()) { if (mWakeLock != null && mWakeLock.isHeld()) { Rlog.e(LOG_TAG, "UNEXPECTED; mWakeLock is held when finalizing."); Rlog.e(LOG_TAG, "UNEXPECTED; mWakeLock is held when finalizing."); mWakeLock.release(); mWakeLock.release(); } } Loading
src/java/com/android/internal/telephony/RIL.java +201 −90 Original line number Original line Diff line number Diff line Loading @@ -1384,14 +1384,20 @@ public final class RIL extends BaseCommands implements CommandsInterface { } } @Override @Override public void public void getSignalStrength(Message result) { getSignalStrength (Message result) { IRadio radioProxy = getRadioProxy(result); RILRequest rr if (radioProxy != null) { = RILRequest.obtain(RIL_REQUEST_SIGNAL_STRENGTH, result, mRILDefaultWorkSource); RILRequest rr = obtainRequest(RIL_REQUEST_SIGNAL_STRENGTH, result, mRILDefaultWorkSource); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); send(rr); try { radioProxy.getSignalStrength(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getSignalStrength", e); } } } } @Override @Override Loading Loading @@ -1537,10 +1543,34 @@ public final class RIL extends BaseCommands implements CommandsInterface { } } @Override @Override public void public void setupDataCall(int radioTechnology, int profile, String apn, setupDataCall(int radioTechnology, int profile, String apn, String user, String password, int authType, String protocol, String user, String password, int authType, String protocol, Message result) { Message result) { /* todo: hidlize IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_SETUP_DATA_CALL, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " radioTechnology = " + radioTechnology + " profile = " + profile + " apn = " + apn + " user = " + user + " password = " + password + " authType = " + authType + " protocol = " + protocol); } try { radioProxy.setupDataCall(rr.mSerial, radioTechnology + 2, profile, convertNullToEmptyString(apn), convertNullToEmptyString(user), convertNullToEmptyString(password), authType, convertNullToEmptyString(protocol)); mMetrics.writeRilSetupDataCall(mPhoneId, rr.mSerial, radioTechnology, profile, apn, authType, protocol); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "setupDataCall", e); } } */ RILRequest rr RILRequest rr = RILRequest.obtain(RIL_REQUEST_SETUP_DATA_CALL, result, mRILDefaultWorkSource); = RILRequest.obtain(RIL_REQUEST_SETUP_DATA_CALL, result, mRILDefaultWorkSource); Loading Loading @@ -2147,12 +2177,19 @@ public final class RIL extends BaseCommands implements CommandsInterface { @Override @Override public void getDataCallList(Message result) { public void getDataCallList(Message result) { RILRequest rr = RILRequest.obtain(RIL_REQUEST_DATA_CALL_LIST, result, IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_DATA_CALL_LIST, result, mRILDefaultWorkSource); mRILDefaultWorkSource); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); send(rr); try { radioProxy.getDataCallList(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getDataCallList", e); } } } } @Override @Override Loading Loading @@ -3119,11 +3156,21 @@ public final class RIL extends BaseCommands implements CommandsInterface { @Override @Override public void getCellInfoList(Message result, WorkSource workSource) { public void getCellInfoList(Message result, WorkSource workSource) { workSource = getDeafultWorkSourceIfInvalid(workSource); workSource = getDeafultWorkSourceIfInvalid(workSource); IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_GET_CELL_INFO_LIST, result, workSource); RILRequest rr = RILRequest.obtain(RIL_REQUEST_GET_CELL_INFO_LIST, result, workSource); if (RILJ_LOGD) { if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } send(rr); try { radioProxy.getCellInfoList(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getCellInfoList", e); } } } } @Override @Override Loading Loading @@ -3518,12 +3565,20 @@ public final class RIL extends BaseCommands implements CommandsInterface { @Override @Override public void public void getHardwareConfig (Message result) { getHardwareConfig (Message result) { RILRequest rr = RILRequest.obtain(RIL_REQUEST_GET_HARDWARE_CONFIG, result, IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_GET_HARDWARE_CONFIG, result, mRILDefaultWorkSource); mRILDefaultWorkSource); // Do not log function args for privacy if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); send(rr); try { radioProxy.getHardwareConfig(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getHardwareConfig", e); } } } } @Override @Override Loading Loading @@ -3627,32 +3682,50 @@ public final class RIL extends BaseCommands implements CommandsInterface { @Override @Override public void getRadioCapability(Message response) { public void getRadioCapability(Message response) { RILRequest rr = RILRequest.obtain( IRadio radioProxy = getRadioProxy(response); RIL_REQUEST_GET_RADIO_CAPABILITY, response, mRILDefaultWorkSource); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_GET_RADIO_CAPABILITY, response, mRILDefaultWorkSource); if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } send(rr); try { radioProxy.getRadioCapability(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "getRadioCapability", e); } } } } @Override @Override public void setRadioCapability(RadioCapability rc, Message response) { public void setRadioCapability(RadioCapability rc, Message response) { RILRequest rr = RILRequest.obtain( IRadio radioProxy = getRadioProxy(response); RIL_REQUEST_SET_RADIO_CAPABILITY, response, mRILDefaultWorkSource); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_SET_RADIO_CAPABILITY, response, rr.mParcel.writeInt(rc.getVersion()); mRILDefaultWorkSource); rr.mParcel.writeInt(rc.getSession()); rr.mParcel.writeInt(rc.getPhase()); rr.mParcel.writeInt(rc.getRadioAccessFamily()); rr.mParcel.writeString(rc.getLogicalModemUuid()); rr.mParcel.writeInt(rc.getStatus()); if (RILJ_LOGD) { if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + rc.toString()); + " RadioCapability = " + rc.toString()); } } send(rr); android.hardware.radio.V1_0.RadioCapability halRc = new android.hardware.radio.V1_0.RadioCapability(); halRc.session = rc.getSession(); halRc.phase = rc.getPhase(); halRc.raf = rc.getRadioAccessFamily(); halRc.logicalModemUuid = convertNullToEmptyString(rc.getLogicalModemUuid()); halRc.status = rc.getStatus(); try { radioProxy.setRadioCapability(rr.mSerial, halRc); } catch (Exception e) { handleRadioProxyExceptionForRR(rr, "setRadioCapability", e); } } } } @Override @Override Loading Loading @@ -3696,12 +3769,21 @@ public final class RIL extends BaseCommands implements CommandsInterface { @Override @Override public void pullLceData(Message response) { public void pullLceData(Message response) { RILRequest rr = RILRequest.obtain(RIL_REQUEST_PULL_LCEDATA, response, IRadio radioProxy = getRadioProxy(response); if (radioProxy != null) { RILRequest rr = obtainRequest(RIL_REQUEST_PULL_LCEDATA, response, mRILDefaultWorkSource); mRILDefaultWorkSource); if (RILJ_LOGD) { if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } } send(rr); try { radioProxy.pullLceData(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "pullLceData", e); } } } } @Override @Override Loading Loading @@ -3973,7 +4055,24 @@ public final class RIL extends BaseCommands implements CommandsInterface { int error = responseInfo.error; int error = responseInfo.error; int type = responseInfo.type; int type = responseInfo.type; RILRequest rr = findAndRemoveRequestFromList(serial); RILRequest rr = null; if (type == RadioResponseType.SOLICITED_ACK) { synchronized (mRequestList) { rr = mRequestList.get(serial); } if (rr == null) { Rlog.w(RILJ_LOG_TAG, "Unexpected solicited ack response! sn: " + serial); } else { decrementWakeLock(rr); if (RILJ_LOGD) { riljLog(rr.serialString() + " Ack < " + requestToString(rr.mRequest)); } } return rr; } rr = findAndRemoveRequestFromList(serial); if (rr == null) { if (rr == null) { Rlog.e(RIL.RILJ_LOG_TAG, "processResponse: Unexpected response! serial: " + serial Rlog.e(RIL.RILJ_LOG_TAG, "processResponse: Unexpected response! serial: " + serial + " error: " + error); + " error: " + error); Loading Loading @@ -4366,7 +4465,6 @@ public final class RIL extends BaseCommands implements CommandsInterface { } } } } Object ret = null; Object ret = null; if (error == 0 || p.dataAvail() > 0) { if (error == 0 || p.dataAvail() > 0) { Loading @@ -4377,25 +4475,15 @@ public final class RIL extends BaseCommands implements CommandsInterface { // will be using same code as unsolicited ril commands which will be done in // will be using same code as unsolicited ril commands which will be done in // separate CL. Other RIL commands below are deprecated and require framework // separate CL. Other RIL commands below are deprecated and require framework // code to be modified to remove them completely. // code to be modified to remove them completely. case RIL_REQUEST_SIGNAL_STRENGTH: ret = responseSignalStrength(p); break; case RIL_REQUEST_SETUP_DATA_CALL: ret = responseSetupDataCall(p); break; case RIL_REQUEST_SETUP_DATA_CALL: ret = responseSetupDataCall(p); break; case RIL_REQUEST_GET_IMEI: ret = responseString(p); break; case RIL_REQUEST_GET_IMEI: ret = responseString(p); break; case RIL_REQUEST_GET_IMEISV: ret = responseString(p); break; case RIL_REQUEST_GET_IMEISV: ret = responseString(p); break; case RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE: ret = responseInts(p); break; case RIL_REQUEST_LAST_DATA_CALL_FAIL_CAUSE: ret = responseInts(p); break; case RIL_REQUEST_DATA_CALL_LIST: ret = responseDataCallList(p); break; case RIL_REQUEST_RESET_RADIO: ret = responseVoid(p); break; case RIL_REQUEST_RESET_RADIO: ret = responseVoid(p); break; case RIL_REQUEST_OEM_HOOK_RAW: ret = responseRaw(p); break; case RIL_REQUEST_OEM_HOOK_RAW: ret = responseRaw(p); break; case RIL_REQUEST_STK_GET_PROFILE: ret = responseString(p); break; case RIL_REQUEST_STK_SET_PROFILE: ret = responseVoid(p); break; case RIL_REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY: ret = responseVoid(p); break; case RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING: ret = responseVoid(p); break; case RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING: ret = responseVoid(p); break; case RIL_REQUEST_GET_CELL_INFO_LIST: ret = responseCellInfoList(p); break; case RIL_REQUEST_SET_INITIAL_ATTACH_APN: ret = responseVoid(p); break; case RIL_REQUEST_SET_INITIAL_ATTACH_APN: ret = responseVoid(p); break; case RIL_REQUEST_SET_DATA_PROFILE: ret = responseVoid(p); break; case RIL_REQUEST_SET_DATA_PROFILE: ret = responseVoid(p); break; case RIL_REQUEST_GET_HARDWARE_CONFIG: ret = responseHardwareConfig(p); break; case RIL_REQUEST_GET_RADIO_CAPABILITY: ret = responseRadioCapability(p); break; case RIL_REQUEST_SET_RADIO_CAPABILITY: ret = responseRadioCapability(p); break; case RIL_REQUEST_PULL_LCEDATA: ret = responseLceData(p); break; default: default: throw new RuntimeException("Unrecognized solicited response: " throw new RuntimeException("Unrecognized solicited response: " + rr.mRequest); + rr.mRequest); Loading Loading @@ -4474,7 +4562,7 @@ public final class RIL extends BaseCommands implements CommandsInterface { return rr; return rr; } } private RadioCapability makeStaticRadioCapability() { RadioCapability makeStaticRadioCapability() { // default to UNKNOWN so we fail fast. // default to UNKNOWN so we fail fast. int raf = RadioAccessFamily.RAF_UNKNOWN; int raf = RadioAccessFamily.RAF_UNKNOWN; Loading Loading @@ -5440,9 +5528,7 @@ public final class RIL extends BaseCommands implements CommandsInterface { return ret; return ret; } } static ArrayList<DataCallResponse> convertHalDcList(ArrayList<SetupDataCallResult> dcList) { static DataCallResponse convertHalDc(SetupDataCallResult dc) { ArrayList<DataCallResponse> dcResponseList = new ArrayList<>(dcList.size()); for (SetupDataCallResult dc : dcList) { DataCallResponse dcResponse = new DataCallResponse(); DataCallResponse dcResponse = new DataCallResponse(); // todo: get rid of this version field? // todo: get rid of this version field? // todo: create a DataCallResponse constructor that takes in these fields to make sure // todo: create a DataCallResponse constructor that takes in these fields to make sure Loading Loading @@ -5476,6 +5562,13 @@ public final class RIL extends BaseCommands implements CommandsInterface { } } dcResponse.mtu = dc.mtu; dcResponse.mtu = dc.mtu; return dcResponse; } static ArrayList<DataCallResponse> convertHalDcList(ArrayList<SetupDataCallResult> dcList) { ArrayList<DataCallResponse> dcResponseList = new ArrayList<>(dcList.size()); for (SetupDataCallResult dc : dcList) { DataCallResponse dcResponse = convertHalDc(dc); dcResponseList.add(dcResponse); dcResponseList.add(dcResponse); } } return dcResponseList; return dcResponseList; Loading Loading @@ -5556,7 +5649,7 @@ public final class RIL extends BaseCommands implements CommandsInterface { return capacityResponse; return capacityResponse; } } static ArrayList<CellInfo> responseCellInfoList( static ArrayList<CellInfo> convertHalCellInfoList( ArrayList<android.hardware.radio.V1_0.CellInfo> records) { ArrayList<android.hardware.radio.V1_0.CellInfo> records) { ArrayList<CellInfo> response = new ArrayList<CellInfo>(records.size()); ArrayList<CellInfo> response = new ArrayList<CellInfo>(records.size()); Loading Loading @@ -5637,4 +5730,22 @@ public final class RIL extends BaseCommands implements CommandsInterface { return response; return response; } } static SignalStrength convertHalSignalStrength( android.hardware.radio.V1_0.SignalStrength signalStrength) { return new SignalStrength(signalStrength.gw.signalStrength, signalStrength.gw.bitErrorRate, signalStrength.cdma.dbm, signalStrength.cdma.ecio, signalStrength.evdo.dbm, signalStrength.evdo.ecio, signalStrength.evdo.signalNoiseRatio, signalStrength.lte.signalStrength, signalStrength.lte.rsrp, signalStrength.lte.rsrq, signalStrength.lte.rssnr, signalStrength.lte.cqi, signalStrength.tdScdma.rscp, false /* gsmFlag - don't care; will be changed by SST */); } } }
src/java/com/android/internal/telephony/RadioIndication.java +2 −16 Original line number Original line Diff line number Diff line Loading @@ -219,21 +219,7 @@ public class RadioIndication extends IRadioIndication.Stub { android.hardware.radio.V1_0.SignalStrength signalStrength) { android.hardware.radio.V1_0.SignalStrength signalStrength) { mRil.processIndication(indicationType); mRil.processIndication(indicationType); SignalStrength ss = new SignalStrength(signalStrength.gw.signalStrength, SignalStrength ss = RIL.convertHalSignalStrength(signalStrength); signalStrength.gw.bitErrorRate, signalStrength.cdma.dbm, signalStrength.cdma.ecio, signalStrength.evdo.dbm, signalStrength.evdo.ecio, signalStrength.evdo.signalNoiseRatio, signalStrength.lte.signalStrength, signalStrength.lte.rsrp, signalStrength.lte.rsrq, signalStrength.lte.rssnr, signalStrength.lte.cqi, signalStrength.tdScdma.rscp, false /* gsmFlag - don't care; will be changed by SST */); // Note this is set to "verbose" because it happens frequently // Note this is set to "verbose" because it happens frequently if (RIL.RILJ_LOGV) mRil.unsljLogvRet(RIL_UNSOL_SIGNAL_STRENGTH, ss); if (RIL.RILJ_LOGV) mRil.unsljLogvRet(RIL_UNSOL_SIGNAL_STRENGTH, ss); Loading Loading @@ -649,7 +635,7 @@ public class RadioIndication extends IRadioIndication.Stub { ArrayList<android.hardware.radio.V1_0.CellInfo> records) { ArrayList<android.hardware.radio.V1_0.CellInfo> records) { mRil.processIndication(indicationType); mRil.processIndication(indicationType); ArrayList<CellInfo> response = RIL.responseCellInfoList(records); ArrayList<CellInfo> response = RIL.convertHalCellInfoList(records); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CELL_INFO_LIST, response); if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_CELL_INFO_LIST, response); Loading
src/java/com/android/internal/telephony/RadioResponse.java +154 −9 File changed.Preview size limit exceeded, changes collapsed. Show changes