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

Commit 5cea5563 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Make PCC indication logic consistent between HIDL and AIDL" am: 2e57ed94

parents c5126ea2 2e57ed94
Loading
Loading
Loading
Loading
+34 −27
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ public class NetworkIndication extends IRadioNetworkIndication.Stub {
            android.hardware.radio.network.PhysicalChannelConfig[] configs) {
        mRil.processIndication(RIL.NETWORK_SERVICE, indicationType);
        List<PhysicalChannelConfig> response = new ArrayList<>(configs.length);
        try {
            for (android.hardware.radio.network.PhysicalChannelConfig config : configs) {
                PhysicalChannelConfig.Builder builder = new PhysicalChannelConfig.Builder();
                switch (config.band.getTag()) {
@@ -169,6 +170,12 @@ public class NetworkIndication extends IRadioNetworkIndication.Stub {
                        .setContextIds(config.contextIds)
                        .build());
            }
        } catch (IllegalArgumentException iae) {
            AnomalyReporter.reportAnomaly(UUID.fromString("918f0970-9aa9-4bcd-a28e-e49a83fe77d5"),
                    "RIL reported invalid PCC (AIDL)");
            mRil.riljLoge("Invalid PhysicalChannelConfig " + iae);
            return;
        }
        if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_PHYSICAL_CHANNEL_CONFIG, response);

        mRil.mPhysicalChannelConfigurationRegistrants.notifyRegistrants(
+1 −1
Original line number Diff line number Diff line
@@ -1241,7 +1241,7 @@ public class RadioIndication extends IRadioIndication.Stub {
            }
        } catch (IllegalArgumentException iae) {
            reportAnomaly(UUID.fromString("918f0970-9aa9-4bcd-a28e-e49a83fe77d5"),
                    "Invalid PhysicalChannelConfig reported by HAL");
                    "RIL reported invalid PCC (HIDL)");
            mRil.riljLoge("Invalid PhysicalChannelConfig " + iae);
            return;
        }
+6 −3
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ package com.android.internal.telephony;

import static com.google.common.truth.Truth.assertThat;

import static org.junit.Assert.fail;

import android.os.Parcel;
import android.telephony.AccessNetworkConstants;
import android.telephony.PhysicalChannelConfig;
@@ -128,9 +130,10 @@ public class PhysicalChannelConfigTest {

    @Test
    public void testFrequencyRangeWithoutBand() {
        try {
            setUpPhysicalChannelConfig(NETWORK_TYPE_UMTS, 0, CHANNEL_NUMBER, CHANNEL_NUMBER, -1);
        assertThat(mPhysicalChannelConfig.getFrequencyRange())
                .isEqualTo(ServiceState.FREQUENCY_RANGE_UNKNOWN);
            fail();
        } catch (IllegalArgumentException expected) { }
    }

    @Test