OSDN Git Service

Fix apn bearer logic.
authorRobert Greenwalt <rgreenwalt@google.com>
Thu, 22 Sep 2011 18:49:01 +0000 (11:49 -0700)
committerRobert Greenwalt <rgreenwalt@google.com>
Thu, 22 Sep 2011 18:49:01 +0000 (11:49 -0700)
The original change said that if the RAT were X or Y we would only
accept APN's that explicitly called out X or Y.  This meant that
any device using X or Y would stop working until their APN db were
adjusted.

This change changes it to be if a particular APN calls out X or Y
it will only be considered if the current RAT matches.  If the APN
doesn't specify, it matches all RAT.

This allows just as tight a restriction, but the default is looser.

Change-Id: Ia5e92f13c5052e890bf169e0db9584302afb36f5

telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java

index c62ccc6..78ba7dd 100644 (file)
@@ -2087,18 +2087,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
     }
 
     /**
-     * Check current radio access technology is LTE or EHRPD.
-     *
-     * @param integer value of radio access technology
-     * @return true when current radio access technology is LTE or EHRPD
-     * @          false when current radio access technology is not LTE or EHRPD
-     */
-    private boolean needToCheckApnBearer(int radioTech) {
-        return (radioTech == ServiceState.RADIO_TECHNOLOGY_LTE ||
-                radioTech == ServiceState.RADIO_TECHNOLOGY_EHRPD);
-    }
-
-    /**
      * Build a list of APNs to be used to create PDP's.
      *
      * @param requestedApnType
@@ -2119,7 +2107,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
 
         String operator = mPhone.mIccRecords.getOperatorNumeric();
         int radioTech = mPhone.getServiceState().getRadioTechnology();
-        boolean needToCheckApnBearer = needToCheckApnBearer(radioTech);
 
         if (requestedApnType.equals(Phone.APN_TYPE_DEFAULT)) {
             if (canSetPreferApn && mPreferredApn != null) {
@@ -2128,7 +2115,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
                         + mPreferredApn.numeric + ":" + mPreferredApn);
                 }
                 if (mPreferredApn.numeric.equals(operator)) {
-                    if (!needToCheckApnBearer || mPreferredApn.bearer == radioTech) {
+                    if (mPreferredApn.bearer == 0 || mPreferredApn.bearer == radioTech) {
                         apnList.add(mPreferredApn);
                         if (DBG) log("buildWaitingApns: X added preferred apnList=" + apnList);
                         return apnList;
@@ -2147,7 +2134,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
         if (mAllApns != null) {
             for (ApnSetting apn : mAllApns) {
                 if (apn.canHandleType(requestedApnType)) {
-                    if (!needToCheckApnBearer || apn.bearer == radioTech) {
+                    if (apn.bearer == 0 || apn.bearer == radioTech) {
                         if (DBG) log("apn info : " +apn.toString());
                         apnList.add(apn);
                     }