Loading src/java/com/android/internal/telephony/PhoneProxy.java +3 −0 Original line number Diff line number Diff line Loading @@ -1489,6 +1489,9 @@ public class PhoneProxy extends Handler implements Phone { mActivePhone.unregisterForRadioCapabilityChanged(h); } public IccCardProxy getPhoneIccCardProxy() { return mIccCardProxy; } public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { try { ((PhoneBase)mActivePhone).dump(fd, pw, args); Loading src/java/com/android/internal/telephony/ServiceStateTracker.java +36 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.telephony; import static com.android.internal.telephony.TelephonyProperties.PROPERTY_ICC_OPERATOR_ALPHA; import android.app.PendingIntent; import android.content.Context; import android.content.IntentFilter; Loading @@ -34,6 +36,7 @@ import android.telephony.SubscriptionManager; import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; import android.util.Pair; import android.util.TimeUtils; Loading @@ -44,6 +47,7 @@ import java.util.List; import com.android.internal.telephony.dataconnection.DcTrackerBase; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState; import com.android.internal.telephony.uicc.IccCardProxy; import com.android.internal.telephony.uicc.IccRecords; import com.android.internal.telephony.uicc.UiccCardApplication; import com.android.internal.telephony.uicc.UiccController; Loading Loading @@ -230,10 +234,40 @@ public abstract class ServiceStateTracker extends Handler { public void onSubscriptionsChanged() { if (DBG) log("SubscriptionListener.onSubscriptionInfoChanged"); // Set the network type, in case the radio does not restore it. if (mPhoneBase.getSubId() != SubscriptionManager.INVALID_SUBSCRIPTION_ID) { int subId = mPhoneBase.getSubId(); if (SubscriptionManager.isValidSubId(subId)) { int networkType = PhoneFactory.calculatePreferredNetworkType( mPhoneBase.getContext(), mPhoneBase.getSubId()); mPhoneBase.getContext(), subId); mCi.setPreferredNetworkType(networkType, null); //store OperatorNumeric in case subId is not valid when EVENT_RECORDS_LOADED issued int phoneId = mPhoneBase.getPhoneId(); PhoneProxy[] phoneProxys = (PhoneProxy[]) PhoneFactory.getPhones(); if(phoneProxys != null && phoneProxys.length > phoneId) { PhoneProxy phoneProxy = phoneProxys[phoneId]; if(phoneProxy != null) { IccCardProxy iccCardProxy = phoneProxy.getPhoneIccCardProxy(); if(iccCardProxy != null) { iccCardProxy.saveOperatorNumeric(); // store alpha if(iccCardProxy.getIccRecord() != null) { TelephonyManager.setTelephonyProperty(phoneId, PROPERTY_ICC_OPERATOR_ALPHA, iccCardProxy.getIccRecord().getServiceProviderName()); } else { Log.e(LOG_TAG,"IccRecord is null"); } } else { Log.e(LOG_TAG,"iccCardProxy is null"); } }else { Log.e(LOG_TAG, "Null phoneProxy"); } } else { Log.e(LOG_TAG, "invalid phoneProxy[] or PhoneId" + phoneId); } mPhoneBase.setSystemProperty(TelephonyProperties.PROPERTY_DATA_NETWORK_TYPE, ServiceState.rilRadioTechnologyToString(mSS.getRilDataRadioTechnology())); } } }; Loading src/java/com/android/internal/telephony/uicc/IccCardProxy.java +29 −16 Original line number Diff line number Diff line Loading @@ -224,6 +224,28 @@ public class IccCardProxy extends Handler implements IccCard { } } public void saveOperatorNumeric() { if (mIccRecords != null) { String operator = mIccRecords.getOperatorNumeric(); int slotId = mCardIndex; log("operator=" + operator + " slotId=" + slotId); if (operator != null) { log("update icc_operator_numeric=" + operator); setSystemProperty(PROPERTY_ICC_OPERATOR_NUMERIC, slotId, operator); String countryCode = operator.substring(0,3); if (countryCode != null) { setSystemProperty(PROPERTY_ICC_OPERATOR_ISO_COUNTRY, slotId, MccTable.countryCodeForMcc(Integer.parseInt(countryCode))); } else { loge("EVENT_RECORDS_LOADED Country code is null"); } } else { loge("EVENT_RECORDS_LOADED Operator name is null"); } } } @Override public void handleMessage(Message msg) { switch (msg.what) { Loading Loading @@ -256,22 +278,10 @@ public class IccCardProxy extends Handler implements IccCard { break; case EVENT_RECORDS_LOADED: if (mIccRecords != null) { saveOperatorNumeric(); String operator = mIccRecords.getOperatorNumeric(); int slotId = mCardIndex; log("operator=" + operator + " slotId=" + slotId); if(operator != null) { log("update icc_operator_numeric=" + operator); setSystemProperty(PROPERTY_ICC_OPERATOR_NUMERIC, slotId, operator); String countryCode = operator.substring(0,3); if (countryCode != null) { setSystemProperty(PROPERTY_ICC_OPERATOR_ISO_COUNTRY, slotId, MccTable.countryCodeForMcc(Integer.parseInt(countryCode))); } else { loge("EVENT_RECORDS_LOADED Country code is null"); } int slotId = mCardIndex; int[] subId = SubscriptionController.getInstance().getSubId(slotId); if (subId != null) { // Update MCC MNC device configuration information only for default sub. Loading Loading @@ -894,6 +904,9 @@ public class IccCardProxy extends Handler implements IccCard { } } public IccRecords getIccRecord() { return mIccRecords; } private void log(String s) { Rlog.d(LOG_TAG, s); } Loading Loading
src/java/com/android/internal/telephony/PhoneProxy.java +3 −0 Original line number Diff line number Diff line Loading @@ -1489,6 +1489,9 @@ public class PhoneProxy extends Handler implements Phone { mActivePhone.unregisterForRadioCapabilityChanged(h); } public IccCardProxy getPhoneIccCardProxy() { return mIccCardProxy; } public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { try { ((PhoneBase)mActivePhone).dump(fd, pw, args); Loading
src/java/com/android/internal/telephony/ServiceStateTracker.java +36 −2 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.internal.telephony; import static com.android.internal.telephony.TelephonyProperties.PROPERTY_ICC_OPERATOR_ALPHA; import android.app.PendingIntent; import android.content.Context; import android.content.IntentFilter; Loading @@ -34,6 +36,7 @@ import android.telephony.SubscriptionManager; import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; import android.util.Pair; import android.util.TimeUtils; Loading @@ -44,6 +47,7 @@ import java.util.List; import com.android.internal.telephony.dataconnection.DcTrackerBase; import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState; import com.android.internal.telephony.uicc.IccCardProxy; import com.android.internal.telephony.uicc.IccRecords; import com.android.internal.telephony.uicc.UiccCardApplication; import com.android.internal.telephony.uicc.UiccController; Loading Loading @@ -230,10 +234,40 @@ public abstract class ServiceStateTracker extends Handler { public void onSubscriptionsChanged() { if (DBG) log("SubscriptionListener.onSubscriptionInfoChanged"); // Set the network type, in case the radio does not restore it. if (mPhoneBase.getSubId() != SubscriptionManager.INVALID_SUBSCRIPTION_ID) { int subId = mPhoneBase.getSubId(); if (SubscriptionManager.isValidSubId(subId)) { int networkType = PhoneFactory.calculatePreferredNetworkType( mPhoneBase.getContext(), mPhoneBase.getSubId()); mPhoneBase.getContext(), subId); mCi.setPreferredNetworkType(networkType, null); //store OperatorNumeric in case subId is not valid when EVENT_RECORDS_LOADED issued int phoneId = mPhoneBase.getPhoneId(); PhoneProxy[] phoneProxys = (PhoneProxy[]) PhoneFactory.getPhones(); if(phoneProxys != null && phoneProxys.length > phoneId) { PhoneProxy phoneProxy = phoneProxys[phoneId]; if(phoneProxy != null) { IccCardProxy iccCardProxy = phoneProxy.getPhoneIccCardProxy(); if(iccCardProxy != null) { iccCardProxy.saveOperatorNumeric(); // store alpha if(iccCardProxy.getIccRecord() != null) { TelephonyManager.setTelephonyProperty(phoneId, PROPERTY_ICC_OPERATOR_ALPHA, iccCardProxy.getIccRecord().getServiceProviderName()); } else { Log.e(LOG_TAG,"IccRecord is null"); } } else { Log.e(LOG_TAG,"iccCardProxy is null"); } }else { Log.e(LOG_TAG, "Null phoneProxy"); } } else { Log.e(LOG_TAG, "invalid phoneProxy[] or PhoneId" + phoneId); } mPhoneBase.setSystemProperty(TelephonyProperties.PROPERTY_DATA_NETWORK_TYPE, ServiceState.rilRadioTechnologyToString(mSS.getRilDataRadioTechnology())); } } }; Loading
src/java/com/android/internal/telephony/uicc/IccCardProxy.java +29 −16 Original line number Diff line number Diff line Loading @@ -224,6 +224,28 @@ public class IccCardProxy extends Handler implements IccCard { } } public void saveOperatorNumeric() { if (mIccRecords != null) { String operator = mIccRecords.getOperatorNumeric(); int slotId = mCardIndex; log("operator=" + operator + " slotId=" + slotId); if (operator != null) { log("update icc_operator_numeric=" + operator); setSystemProperty(PROPERTY_ICC_OPERATOR_NUMERIC, slotId, operator); String countryCode = operator.substring(0,3); if (countryCode != null) { setSystemProperty(PROPERTY_ICC_OPERATOR_ISO_COUNTRY, slotId, MccTable.countryCodeForMcc(Integer.parseInt(countryCode))); } else { loge("EVENT_RECORDS_LOADED Country code is null"); } } else { loge("EVENT_RECORDS_LOADED Operator name is null"); } } } @Override public void handleMessage(Message msg) { switch (msg.what) { Loading Loading @@ -256,22 +278,10 @@ public class IccCardProxy extends Handler implements IccCard { break; case EVENT_RECORDS_LOADED: if (mIccRecords != null) { saveOperatorNumeric(); String operator = mIccRecords.getOperatorNumeric(); int slotId = mCardIndex; log("operator=" + operator + " slotId=" + slotId); if(operator != null) { log("update icc_operator_numeric=" + operator); setSystemProperty(PROPERTY_ICC_OPERATOR_NUMERIC, slotId, operator); String countryCode = operator.substring(0,3); if (countryCode != null) { setSystemProperty(PROPERTY_ICC_OPERATOR_ISO_COUNTRY, slotId, MccTable.countryCodeForMcc(Integer.parseInt(countryCode))); } else { loge("EVENT_RECORDS_LOADED Country code is null"); } int slotId = mCardIndex; int[] subId = SubscriptionController.getInstance().getSubId(slotId); if (subId != null) { // Update MCC MNC device configuration information only for default sub. Loading Loading @@ -894,6 +904,9 @@ public class IccCardProxy extends Handler implements IccCard { } } public IccRecords getIccRecord() { return mIccRecords; } private void log(String s) { Rlog.d(LOG_TAG, s); } Loading