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

Commit d20f9e0f authored by Meng Wang's avatar Meng Wang Committed by Android (Google) Code Review
Browse files

Merge "Remove SubscriptionPlan.getNetworkTypesBitMask"

parents 55f62ab8 a293d8dc
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -133,6 +133,8 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.IntStream;

/**
 * {@hide}
 */
@@ -4033,11 +4035,8 @@ public class DcTracker extends Handler {
            return false;
        }

        long bitmask = TelephonyManager.getBitMaskForNetworkType(networkType);
        boolean isGeneralUnmetered = true;
        for (SubscriptionPlan plan : mSubscriptionPlans) {
            // check plan applies to given network type
            if ((plan.getNetworkTypesBitMask() & bitmask) == bitmask) {
            // check plan is general or specific
            if (plan.getNetworkTypes() == null) {
                if (!isPlanUnmetered(plan)) {
@@ -4045,6 +4044,8 @@ public class DcTracker extends Handler {
                    isGeneralUnmetered = false;
                }
            } else {
                // check plan applies to given network type
                if (IntStream.of(plan.getNetworkTypes()).anyMatch(n -> n == networkType)) {
                    // ensure network type unknown returns general value
                    if (networkType != TelephonyManager.NETWORK_TYPE_UNKNOWN) {
                        // there is only 1 specific plan per network type, so return value if found