use of android.telephony.PcoData in project android_frameworks_opt_telephony by LineageOS.
the class RadioIndication method pcoData.
public void pcoData(int indicationType, PcoDataInfo pco) {
mRil.processIndication(indicationType);
PcoData response = new PcoData(pco.cid, pco.bearerProto, pco.pcoId, RIL.arrayListToPrimitiveArray(pco.contents));
if (RIL.RILJ_LOGD)
mRil.unsljLogRet(RIL_UNSOL_PCO_DATA, response);
mRil.mPcoDataRegistrants.notifyRegistrants(new AsyncResult(null, response, null));
}
use of android.telephony.PcoData in project android_frameworks_opt_telephony by LineageOS.
the class DcTracker method handlePcoData.
private void handlePcoData(AsyncResult ar) {
if (ar.exception != null) {
loge("PCO_DATA exception: " + ar.exception);
return;
}
PcoData pcoData = (PcoData) (ar.result);
ArrayList<DataConnection> dcList = new ArrayList<>();
DataConnection temp = mDcc.getActiveDcByCid(pcoData.cid);
if (temp != null) {
dcList.add(temp);
}
if (dcList.size() == 0) {
loge("PCO_DATA for unknown cid: " + pcoData.cid + ", inferring");
for (DataConnection dc : mDataConnections.values()) {
final int cid = dc.getCid();
if (cid == pcoData.cid) {
if (VDBG)
log(" found " + dc);
dcList.clear();
dcList.add(dc);
break;
}
// check if this dc is still connecting
if (cid == -1) {
for (ApnContext apnContext : dc.getApnContexts()) {
if (apnContext.getState() == DctConstants.State.CONNECTING) {
if (VDBG)
log(" found potential " + dc);
dcList.add(dc);
break;
}
}
}
}
}
if (dcList.size() == 0) {
loge("PCO_DATA - couldn't infer cid");
return;
}
for (DataConnection dc : dcList) {
List<ApnContext> apnContextList = dc.getApnContexts();
if (apnContextList.size() == 0) {
break;
}
// send one out for each apn type in play
for (ApnContext apnContext : apnContextList) {
String apnType = apnContext.getApnType();
final Intent intent = new Intent(TelephonyManager.ACTION_CARRIER_SIGNAL_PCO_VALUE);
intent.putExtra(TelephonyManager.EXTRA_APN_TYPE, apnType);
intent.putExtra(TelephonyManager.EXTRA_APN_TYPE_INT, ApnSetting.getApnTypesBitmaskFromString(apnType));
intent.putExtra(TelephonyManager.EXTRA_APN_PROTOCOL, pcoData.bearerProto);
intent.putExtra(TelephonyManager.EXTRA_APN_PROTOCOL_INT, ApnSetting.getProtocolIntFromString(pcoData.bearerProto));
intent.putExtra(TelephonyManager.EXTRA_PCO_ID, pcoData.pcoId);
intent.putExtra(TelephonyManager.EXTRA_PCO_VALUE, pcoData.contents);
mPhone.getCarrierSignalAgent().notifyCarrierSignalReceivers(intent);
}
}
}
Aggregations