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

Commit 4c63baea authored by Rambo Wang's avatar Rambo Wang Committed by Android (Google) Code Review
Browse files

Merge "NetworkScanRequestTracker:request with empty RadioAccessSpecifiers is invalid"

parents 5f97d452 61dc40ff
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import android.telephony.TelephonyScanManager;
import android.util.Log;

import com.android.internal.telephony.subscription.SubscriptionManagerService;
import com.android.internal.util.ArrayUtils;

import java.util.Collection;
import java.util.List;
@@ -131,7 +132,7 @@ public final class NetworkScanRequestTracker {
    }

    private boolean isValidScan(NetworkScanRequestInfo nsri) {
        if (nsri.mRequest == null || nsri.mRequest.getSpecifiers() == null) {
        if (nsri.mRequest == null || ArrayUtils.isEmpty(nsri.mRequest.getSpecifiers())) {
            return false;
        }
        if (nsri.mRequest.getSpecifiers().length > NetworkScanRequest.MAX_RADIO_ACCESS_NETWORKS) {
+1 −3
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ import android.testing.TestableLooper;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

@@ -117,8 +116,7 @@ public class NetworkScanRequestTrackerTest extends TelephonyTest {
                .startNetworkScan(any(), any());
    }

    // TODO (b/284020271): turn case back on after fixing the bug
    @Ignore
    @Test
    public void testStartNetworkScan_requestWithEmptySpecifier_shouldNeverScan() throws Exception {
        RadioAccessSpecifier[] specifiers = new RadioAccessSpecifier[]{};
        NetworkScanRequest request = new NetworkScanRequest(