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

Commit f90ff21e authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8332931 from d080f7c9 to tm-d1-release

Change-Id: I86e308d842d5016a82783bda5d4ccd7a548adbdd
parents b421b5f4 d080f7c9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ message VoiceCallSession {
    optional bool video_enabled = 29;
    optional int32 rat_at_connected = 30;
    optional bool is_multiparty = 31;

    optional int32 call_duration = 32;
    // Internal use only
    optional int64 setup_begin_millis = 10001;
}
+8 −1
Original line number Diff line number Diff line
@@ -269,7 +269,14 @@ public class VoiceResponse extends IRadioVoiceResponse.Stub {
     * @param enable true for "vonr enabled" and false for "vonr disabled"
     */
    public void isVoNrEnabledResponse(RadioResponseInfo responseInfo, boolean enable) {
        RadioResponse.responseInts(RIL.VOICE_SERVICE, mRil, responseInfo, enable ? 1 : 0);
        RILRequest rr = mRil.processResponse(RIL.VOICE_SERVICE, responseInfo);

        if (rr != null) {
            if (responseInfo.error == RadioError.NONE) {
                RadioResponse.sendMessageResponse(rr.mResult, enable);
            }
            mRil.processResponseDone(rr, responseInfo, enable);
        }
    }

    /**
+39 −12
Original line number Diff line number Diff line
@@ -579,6 +579,8 @@ public class DataNetworkController extends Handler {

        private static final String RULE_TAG_TYPE = "type";

        private static final String RULE_TAG_CAPABILITIES = "capabilities";

        private static final String RULE_TAG_ROAMING = "roaming";

        /** Handover rule type. */
@@ -590,6 +592,12 @@ public class DataNetworkController extends Handler {
        /** The applicable target access networks for handover. */
        public final @NonNull @RadioAccessNetworkType Set<Integer> targetAccessNetworks;

        /**
         * The network capabilities to any of which this handover rule applies.
         * If is empty, then capability is ignored as a rule matcher.
         */
        public final @NonNull @NetCapability Set<Integer> networkCapabilities;

        /** {@code true} indicates this policy is only applicable when the device is roaming. */
        public final boolean isOnlyForRoaming;

@@ -605,7 +613,7 @@ public class DataNetworkController extends Handler {
                throw new IllegalArgumentException("illegal rule " + ruleString);
            }

            Set<Integer> source = null, target = null;
            Set<Integer> source = null, target = null, capabilities = Collections.emptySet();
            int type = 0;
            boolean roaming = false;

@@ -642,6 +650,9 @@ public class DataNetworkController extends Handler {
                                throw new IllegalArgumentException("unexpected rule type " + value);
                            }
                            break;
                        case RULE_TAG_CAPABILITIES:
                            capabilities = DataUtils.getNetworkCapabilitiesFromString(value);
                            break;
                        case RULE_TAG_ROAMING:
                            roaming = Boolean.parseBoolean(value);
                            break;
@@ -655,7 +666,7 @@ public class DataNetworkController extends Handler {
                }
            }

            if (source == null || target == null) {
            if (source == null || target == null || source.isEmpty() || target.isEmpty()) {
                throw new IllegalArgumentException("Need to specify both source and target. "
                        + "\"" + ruleString + "\"");
            }
@@ -675,6 +686,11 @@ public class DataNetworkController extends Handler {
                        + "\"" + ruleString + "\"");
            }

            if (capabilities != null && capabilities.contains(-1)) {
                throw new IllegalArgumentException("Network capabilities contains unknown. "
                            + "\"" + ruleString + "\"");
            }

            if (!source.contains(AccessNetworkType.IWLAN)
                    && !target.contains(AccessNetworkType.IWLAN)) {
                throw new IllegalArgumentException("IWLAN must be specified in either source or "
@@ -684,6 +700,7 @@ public class DataNetworkController extends Handler {
            sourceAccessNetworks = source;
            targetAccessNetworks = target;
            this.type = type;
            networkCapabilities = capabilities;
            isOnlyForRoaming = roaming;
        }

@@ -693,7 +710,9 @@ public class DataNetworkController extends Handler {
                    : "disallowed") + ", source=" + sourceAccessNetworks.stream()
                    .map(AccessNetworkType::toString).collect(Collectors.joining("|"))
                    + ", target=" + targetAccessNetworks.stream().map(AccessNetworkType::toString)
                    .collect(Collectors.joining("|")) + ", isRoaming=" + isOnlyForRoaming + "]";
                    .collect(Collectors.joining("|")) + ", isRoaming=" + isOnlyForRoaming
                    + ", capabilities=" + DataUtils.networkCapabilitiesToString(networkCapabilities)
                    + "]";
        }
    }

@@ -1618,10 +1637,12 @@ public class DataNetworkController extends Handler {
                getDataNetworkType(dataNetwork.getTransport()));
        int targetAccessNetwork = DataUtils.networkTypeToAccessNetworkType(
                getDataNetworkType(DataUtils.getTargetTransport(dataNetwork.getTransport())));
        NetworkCapabilities capabilities = dataNetwork.getNetworkCapabilities();
        log("evaluateDataNetworkHandover: "
                + "source=" + AccessNetworkType.toString(sourceAccessNetwork)
                + ", target=" + AccessNetworkType.toString(targetAccessNetwork)
                + ", ServiceState=" + mServiceState);
                + ", ServiceState=" + mServiceState
                + ", capabilities=" + capabilities);

        // Matching the rules by the configured order. Bail out if find first matching rule.
        for (HandoverRule rule : handoverRules) {
@@ -1630,6 +1651,11 @@ public class DataNetworkController extends Handler {

            if (rule.sourceAccessNetworks.contains(sourceAccessNetwork)
                    && rule.targetAccessNetworks.contains(targetAccessNetwork)) {
                // if no capability rule specified, data network capability is considered matched.
                // otherwise, any capabilities overlap is also considered matched.
                if (rule.networkCapabilities.isEmpty()
                        || rule.networkCapabilities.stream()
                        .anyMatch(capabilities::hasCapability)) {
                    log("evaluateDataNetworkHandover: Matched " + rule);
                    if (rule.type == HandoverRule.RULE_TYPE_DISALLOWED) {
                        dataEvaluation.addDataDisallowedReason(
@@ -1641,6 +1667,7 @@ public class DataNetworkController extends Handler {
                    return dataEvaluation;
                }
            }
        }

        log("evaluateDataNetworkHandover: Did not find matching rule. " + dataEvaluation);
        // Allow handover anyway if no rule is found.
+24 −11
Original line number Diff line number Diff line
@@ -93,6 +93,9 @@ public class DataRetryManager extends Handler {
    /** Event for modem reset. */
    private static final int EVENT_MODEM_RESET = 9;

    /** Event for tracking area code change. */
    private static final int EVENT_TAC_CHANGED = 10;

    /** The maximum entries to preserve. */
    private static final int MAXIMUM_HISTORICAL_ENTRIES = 100;

@@ -102,26 +105,31 @@ public class DataRetryManager extends Handler {
                    RESET_REASON_RADIO_ON,
                    RESET_REASON_MODEM_RESTART,
                    RESET_REASON_DATA_SERVICE_BOUND,
                    RESET_REASON_DATA_CONFIG_CHANGED,
                    RESET_REASON_TAC_CHANGED,
            })
    public @interface RetryResetReason {}

    /** Reset due to data profiles changed. */
    public static final int RESET_REASON_DATA_PROFILES_CHANGED = 1;
    private static final int RESET_REASON_DATA_PROFILES_CHANGED = 1;

    /** Reset due to radio on. This could happen after airplane mode off or RIL restarted. */
    public static final int RESET_REASON_RADIO_ON = 2;
    private static final int RESET_REASON_RADIO_ON = 2;

    /** Reset due to modem restarted. */
    public static final int RESET_REASON_MODEM_RESTART = 3;
    private static final int RESET_REASON_MODEM_RESTART = 3;

    /**
     * Reset due to data service bound. This could happen when reboot or when data service crashed
     * and rebound.
     */
    public static final int RESET_REASON_DATA_SERVICE_BOUND = 4;
    private static final int RESET_REASON_DATA_SERVICE_BOUND = 4;

    /** Reset due to data config changed. */
    public static final int RESET_REASON_DATA_CONFIG_CHANGED = 5;
    private static final int RESET_REASON_DATA_CONFIG_CHANGED = 5;

    /** Reset due to tracking area code changed. */
    private static final int RESET_REASON_TAC_CHANGED = 6;

    /** The phone instance. */
    private final @NonNull Phone mPhone;
@@ -402,16 +410,14 @@ public class DataRetryManager extends Handler {
                String key = tokens[0].trim();
                String value = tokens[1].trim();
                if (key.equals(RULE_TAG_CAPABILITIES)) {
                    mNetworkCapabilities = Arrays.stream(value.split("\\s*\\|\\s*"))
                            .map(String::trim)
                            .map(DataUtils::getNetworkCapabilityFromString)
                            .collect(Collectors.toSet());
                    mNetworkCapabilities = DataUtils.getNetworkCapabilitiesFromString(value);
                }
            }

            if (mNetworkCapabilities.size() == 0 && mFailCauses.size() == 0) {
            if (mFailCauses.isEmpty() && (mNetworkCapabilities.isEmpty()
                    || mNetworkCapabilities.contains(-1))) {
                throw new IllegalArgumentException("illegal rule " + ruleString
                        + ". Should have either network capabilities or fail causes.");
                            + ". Should have either valid network capabilities or fail causes.");
            }
        }

@@ -945,6 +951,8 @@ public class DataRetryManager extends Handler {
                });
        mRil.registerForOn(this, EVENT_RADIO_ON, null);
        mRil.registerForModemReset(this, EVENT_MODEM_RESET, null);

        mPhone.getServiceStateTracker().registerForAreaCodeChanged(this, EVENT_TAC_CHANGED, null);
    }

    @Override
@@ -976,6 +984,9 @@ public class DataRetryManager extends Handler {
            case EVENT_MODEM_RESET:
                onReset(RESET_REASON_MODEM_RESTART);
                break;
            case EVENT_TAC_CHANGED:
                onReset(RESET_REASON_TAC_CHANGED);
                break;
            case EVENT_DATA_PROFILE_UNTHROTTLED:
                ar = (AsyncResult) msg.obj;
                int transport = (int) ar.userObj;
@@ -1562,6 +1573,8 @@ public class DataRetryManager extends Handler {
                return "DATA_SERVICE_BOUND";
            case RESET_REASON_DATA_CONFIG_CHANGED:
                return "DATA_CONFIG_CHANGED";
            case RESET_REASON_TAC_CHANGED:
                return "TAC_CHANGED";
            default:
                return "UNKNOWN(" + reason + ")";
        }
+23 −1
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ import com.android.internal.telephony.data.DataNetworkController.NetworkRequestL
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
@@ -89,6 +91,26 @@ public class DataUtils {
        }
    }

    /**
     * Get Set of network capabilities from string joined by {@code |}, space is ignored.
     * If input string contains unknown capability or malformatted(e.g. empty string), -1 is
     * included in the returned set.
     *
     * @param capabilitiesString capability strings joined by {@code |}
     * @return Set of capabilities
     */
    public static @NetCapability Set<Integer> getNetworkCapabilitiesFromString(
            @NonNull String capabilitiesString) {
        // e.g. "IMS|" is not allowed
        if (!capabilitiesString.matches("(\\s*[a-zA-Z]+\\s*)(\\|\\s*[a-zA-Z]+\\s*)*")) {
            return Collections.singleton(-1);
        }
        return Arrays.stream(capabilitiesString.split("\\s*\\|\\s*"))
                .map(String::trim)
                .map(DataUtils::getNetworkCapabilityFromString)
                .collect(Collectors.toSet());
    }

    /**
     * Convert a network capability to string.
     *
@@ -153,7 +175,7 @@ public class DataUtils {
     * @return Network capabilities in string format.
     */
    public static @NonNull String networkCapabilitiesToString(
            @NetCapability @Nullable List<Integer> netCaps) {
            @NetCapability @Nullable Collection<Integer> netCaps) {
        if (netCaps == null || netCaps.isEmpty()) return "";
        return "[" + netCaps.stream()
                .map(DataUtils::networkCapabilityToString)
Loading