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

Commit c771233f authored by yinxu's avatar yinxu
Browse files

Check whether the bands and channels are null

We need to first check whether bands and channels are null before
doing anything else on them.

Test: Telephony sanity tests
Bug: 30954762
Change-Id: Idaa3ebeabe37248d9de05f8397fecc4dc9938d66
parent 644c6785
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -104,6 +104,9 @@ public final class NetworkScanRequestTracker {
    }

    private boolean isValidScan(NetworkScanRequestInfo nsri) {
        if (nsri.mRequest.specifiers == null) {
            return false;
        }
        if (nsri.mRequest.specifiers.length > NetworkScanRequest.MAX_RADIO_ACCESS_NETWORKS) {
            return false;
        }
@@ -112,8 +115,10 @@ public final class NetworkScanRequestTracker {
                    && ras.radioAccessNetwork != EUTRAN) {
                return false;
            }
            if (ras.bands.length > NetworkScanRequest.MAX_BANDS
                    || ras.channels.length > NetworkScanRequest.MAX_CHANNELS) {
            if (ras.bands != null && ras.bands.length > NetworkScanRequest.MAX_BANDS) {
                return false;
            }
            if (ras.channels != null && ras.channels.length > NetworkScanRequest.MAX_CHANNELS) {
                return false;
            }
        }
+8 −4
Original line number Diff line number Diff line
@@ -1814,12 +1814,16 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                                    + " not supported!");
                            return;
                    }
                    if (ras.bands != null) {
                        for (int band : ras.bands) {
                            bands.add(band);
                        }
                    }
                    if (ras.channels != null) {
                        for (int channel : ras.channels) {
                            s.channels.add(channel);
                        }
                    }
                    request.specifiers.add(s);
                }