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

Commit 976b3f65 authored by Maria Yang's avatar Maria Yang Committed by Automerger Merge Worker
Browse files

Merge "Handle setAllowedCarriers() with empty list of carriers" into sc-v2-dev am: d36f3eb7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16631291

Change-Id: I8eff763b63b01f78fd36dd942dfa923d47198398
parents 2ade4ba3 d36f3eb7
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -12123,12 +12123,15 @@ public class TelephonyManager {
        if (carriers == null || !SubscriptionManager.isValidPhoneId(slotIndex)) {
            return -1;
        }
        // Execute the method setCarrierRestrictionRules with an empty excluded list and
        // indicating priority for the allowed list.
        // Execute the method setCarrierRestrictionRules with an empty excluded list.
        // If the allowed list is empty, it means that all carriers are allowed (default allowed),
        // otherwise it means that only specified carriers are allowed (default not allowed).
        CarrierRestrictionRules carrierRestrictionRules = CarrierRestrictionRules.newBuilder()
                .setAllowedCarriers(carriers)
                .setDefaultCarrierRestriction(
                    CarrierRestrictionRules.CARRIER_RESTRICTION_DEFAULT_NOT_ALLOWED)
                    carriers.isEmpty()
                        ? CarrierRestrictionRules.CARRIER_RESTRICTION_DEFAULT_ALLOWED
                        : CarrierRestrictionRules.CARRIER_RESTRICTION_DEFAULT_NOT_ALLOWED)
                .build();
        int result = setCarrierRestrictionRules(carrierRestrictionRules);