Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd65a4f9 authored by Robert Greenwalt's avatar Robert Greenwalt Committed by Android Git Automerger
Browse files

am 5703ef5b: Merge "Add support for static RadioCapabilities." into mnc-dev

* commit '5703ef5b':
  Add support for static RadioCapabilities.
parents a46a2d74 5703ef5b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2144,4 +2144,11 @@

    <!-- Whether device supports double tap to wake -->
    <bool name="config_supportDoubleTapWake">false</bool>

    <!-- The RadioAccessFamilies supported by the device.
         Empty is viewed as "all".  Only used on devices which
         don't support RIL_REQUEST_GET_RADIO_CAPABILITY
         format is UMTS|LTE|... -->
    <string translatable="false" name="config_radio_access_family"></string>

</resources>
+1 −0
Original line number Diff line number Diff line
@@ -2276,4 +2276,5 @@
  <java-symbol type="id" name="target_badge" />
  <java-symbol type="bool" name="config_supportDoubleTapWake" />
  <java-symbol type="drawable" name="ic_perm_device_info" />
  <java-symbol type="string" name="config_radio_access_family" />
</resources>
+39 −1
Original line number Diff line number Diff line
@@ -255,5 +255,43 @@ public class RadioAccessFamily implements Parcelable {

        return type;
    }

    public static int singleRafTypeFromString(String rafString) {
        switch (rafString) {
            case "GPRS":    return RAF_GPRS;
            case "EDGE":    return RAF_EDGE;
            case "UMTS":    return RAF_UMTS;
            case "IS95A":   return RAF_IS95A;
            case "IS95B":   return RAF_IS95B;
            case "1XRTT":   return RAF_1xRTT;
            case "EVDO_0":  return RAF_EVDO_0;
            case "EVDO_A":  return RAF_EVDO_A;
            case "HSDPA":   return RAF_HSDPA;
            case "HSUPA":   return RAF_HSUPA;
            case "HSPA":    return RAF_HSPA;
            case "EVDO_B":  return RAF_EVDO_B;
            case "EHRPD":   return RAF_EHRPD;
            case "LTE":     return RAF_LTE;
            case "HSPAP":   return RAF_HSPAP;
            case "GSM":     return RAF_GSM;
            case "TD_SCDMA":return RAF_TD_SCDMA;
            case "HS":      return HS;
            case "CDMA":    return CDMA;
            case "EVDO":    return EVDO;
            case "WCDMA":   return WCDMA;
            default:        return RAF_UNKNOWN;
        }
    }

    public static int rafTypeFromString(String rafList) {
        rafList = rafList.toUpperCase();
        String[] rafs = rafList.split("\\|");
        int result = 0;
        for(String raf : rafs) {
            int rafType = singleRafTypeFromString(raf.trim());
            if (rafType == RAF_UNKNOWN) return rafType;
            result |= rafType;
        }
        return result;
    }
}