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

Commit a293d8dc authored by Meng Wang's avatar Meng Wang
Browse files

Remove SubscriptionPlan.getNetworkTypesBitMask

Bug: 140908357
Test: make
Change-Id: Ie7570e948cf552cd449d60dc4e4c5b4553a2a6e9
parent 270a17ad
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}
 */
@@ -4032,11 +4034,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)) {
@@ -4044,6 +4043,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