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

Commit 97d213af authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixed the set/getAllowedNetworkTypes debug messages"

parents 79d91978 575d8846
Loading
Loading
Loading
Loading
+0 −60
Original line number Diff line number Diff line
@@ -3976,66 +3976,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
        }
    }

    /**
     * Returns a string representation of the radio technology (network type)
     * currently in use on the device.
     * @param type for which network type is returned
     * @return the name of the radio technology
     *
     */
    private String getNetworkTypeName(@Annotation.NetworkType int type) {
        switch (type) {
            case TelephonyManager.NETWORK_TYPE_GPRS:
                return "GPRS";
            case TelephonyManager.NETWORK_TYPE_EDGE:
                return "EDGE";
            case TelephonyManager.NETWORK_TYPE_UMTS:
                return "UMTS";
            case TelephonyManager.NETWORK_TYPE_HSDPA:
                return "HSDPA";
            case TelephonyManager.NETWORK_TYPE_HSUPA:
                return "HSUPA";
            case TelephonyManager.NETWORK_TYPE_HSPA:
                return "HSPA";
            case TelephonyManager.NETWORK_TYPE_CDMA:
                return "CDMA";
            case TelephonyManager.NETWORK_TYPE_EVDO_0:
                return "CDMA - EvDo rev. 0";
            case TelephonyManager.NETWORK_TYPE_EVDO_A:
                return "CDMA - EvDo rev. A";
            case TelephonyManager.NETWORK_TYPE_EVDO_B:
                return "CDMA - EvDo rev. B";
            case TelephonyManager.NETWORK_TYPE_1xRTT:
                return "CDMA - 1xRTT";
            case TelephonyManager.NETWORK_TYPE_LTE:
                return "LTE";
            case TelephonyManager.NETWORK_TYPE_EHRPD:
                return "CDMA - eHRPD";
            case TelephonyManager.NETWORK_TYPE_IDEN:
                return "iDEN";
            case TelephonyManager.NETWORK_TYPE_HSPAP:
                return "HSPA+";
            case TelephonyManager.NETWORK_TYPE_GSM:
                return "GSM";
            case TelephonyManager.NETWORK_TYPE_TD_SCDMA:
                return "TD_SCDMA";
            case TelephonyManager.NETWORK_TYPE_IWLAN:
                return "IWLAN";

            //TODO: This network type is marked as hidden because it is not a
            // true network type and we are looking to remove it completely from the available list
            // of network types.  Since this method is only used for logging, in the event that this
            // network type is selected, the log will read as "Unknown."
            //case TelephonyManager.NETWORK_TYPE_LTE_CA:
            //    return "LTE_CA";

            case TelephonyManager.NETWORK_TYPE_NR:
                return "NR";
            default:
                return "UNKNOWN";
        }
    }

    /** Returns a new PreciseCallState object with default values. */
    private static PreciseCallState createPreciseCallState() {
        return new PreciseCallState(PreciseCallState.PRECISE_CALL_STATE_NOT_VALID,
+50 −10
Original line number Diff line number Diff line
@@ -3242,17 +3242,17 @@ public class TelephonyManager {
            case NETWORK_TYPE_CDMA:
                return "CDMA";
            case NETWORK_TYPE_EVDO_0:
                return "CDMA - EvDo rev. 0";
                return "EVDO-0";
            case NETWORK_TYPE_EVDO_A:
                return "CDMA - EvDo rev. A";
                return "EVDO-A";
            case NETWORK_TYPE_EVDO_B:
                return "CDMA - EvDo rev. B";
                return "EVDO-B";
            case NETWORK_TYPE_1xRTT:
                return "CDMA - 1xRTT";
                return "1xRTT";
            case NETWORK_TYPE_LTE:
                return "LTE";
            case NETWORK_TYPE_EHRPD:
                return "CDMA - eHRPD";
                return "eHRPD";
            case NETWORK_TYPE_IDEN:
                return "iDEN";
            case NETWORK_TYPE_HSPAP:
@@ -3260,7 +3260,7 @@ public class TelephonyManager {
            case NETWORK_TYPE_GSM:
                return "GSM";
            case NETWORK_TYPE_TD_SCDMA:
                return "TD_SCDMA";
                return "TD-SCDMA";
            case NETWORK_TYPE_IWLAN:
                return "IWLAN";
            case NETWORK_TYPE_LTE_CA:
@@ -9574,10 +9574,10 @@ public class TelephonyManager {
     */
    public static boolean isValidAllowedNetworkTypesReason(@AllowedNetworkTypesReason int reason) {
        switch (reason) {
            case TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER:
            case TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_POWER:
            case TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_CARRIER:
            case TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G:
            case ALLOWED_NETWORK_TYPES_REASON_USER:
            case ALLOWED_NETWORK_TYPES_REASON_POWER:
            case ALLOWED_NETWORK_TYPES_REASON_CARRIER:
            case ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G:
            case ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS:
                return true;
        }
@@ -18118,4 +18118,44 @@ public class TelephonyManager {
                return "UNKNOWN(" + state + ")";
        }
    }
    /**
     * Convert the allowed network types reason to string.
     *
     * @param reason The allowed network types reason.
     * @return The converted string.
     *
     * @hide
     */
    @NonNull
    public static String allowedNetworkTypesReasonToString(@AllowedNetworkTypesReason int reason) {
        switch (reason) {
            case ALLOWED_NETWORK_TYPES_REASON_USER: return "user";
            case ALLOWED_NETWORK_TYPES_REASON_POWER: return "power";
            case ALLOWED_NETWORK_TYPES_REASON_CARRIER: return "carrier";
            case ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G: return "enable_2g";
            case ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS: return "user_restrictions";
            default: return "unknown(" + reason + ")";
        }
    }
    /**
     * Convert the allowed network types reason from string.
     *
     * @param reason The reason in string format.
     * @return The allowed network types reason.
     *
     * @hide
     */
    @AllowedNetworkTypesReason
    public static int allowedNetworkTypesReasonFromString(@NonNull String reason) {
        switch (reason) {
            case "user": return ALLOWED_NETWORK_TYPES_REASON_USER;
            case "power": return ALLOWED_NETWORK_TYPES_REASON_POWER;
            case "carrier": return ALLOWED_NETWORK_TYPES_REASON_CARRIER;
            case "enable_2g": return ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G;
            case "user_restrictions": return ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS;
            default: return -1;
        }
    }
}