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

Commit 5931718e authored by Sarah Chin's avatar Sarah Chin Committed by Gerrit Code Review
Browse files

Merge "Remove SubscriptionPlan.getNetworkTypesBitMask"

parents f7625799 ed894ac1
Loading
Loading
Loading
Loading
+10 −10
Original line number Original line Diff line number Diff line
@@ -135,6 +135,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Matcher;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.Pattern;
import java.util.stream.IntStream;


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


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