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

Commit 1878ec85 authored by Sarah Chin's avatar Sarah Chin Committed by Automerger Merge Worker
Browse files

Merge "Make PCC indication logic consistent between HIDL and AIDL" into tm-dev...

Merge "Make PCC indication logic consistent between HIDL and AIDL" into tm-dev am: f6525d58 am: 88ee4b0b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/17725712



Change-Id: I4b39d952b6c16e4779ceadb9275f7721452ca7cd
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 92dc65f7 88ee4b0b
Loading
Loading
Loading
Loading
+34 −27
Original line number Original line Diff line number Diff line
@@ -140,6 +140,7 @@ public class NetworkIndication extends IRadioNetworkIndication.Stub {
            android.hardware.radio.network.PhysicalChannelConfig[] configs) {
            android.hardware.radio.network.PhysicalChannelConfig[] configs) {
        mRil.processIndication(RIL.NETWORK_SERVICE, indicationType);
        mRil.processIndication(RIL.NETWORK_SERVICE, indicationType);
        List<PhysicalChannelConfig> response = new ArrayList<>(configs.length);
        List<PhysicalChannelConfig> response = new ArrayList<>(configs.length);
        try {
            for (android.hardware.radio.network.PhysicalChannelConfig config : configs) {
            for (android.hardware.radio.network.PhysicalChannelConfig config : configs) {
                PhysicalChannelConfig.Builder builder = new PhysicalChannelConfig.Builder();
                PhysicalChannelConfig.Builder builder = new PhysicalChannelConfig.Builder();
                switch (config.band.getTag()) {
                switch (config.band.getTag()) {
@@ -169,6 +170,12 @@ public class NetworkIndication extends IRadioNetworkIndication.Stub {
                        .setContextIds(config.contextIds)
                        .setContextIds(config.contextIds)
                        .build());
                        .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);
        if (RIL.RILJ_LOGD) mRil.unsljLogRet(RIL_UNSOL_PHYSICAL_CHANNEL_CONFIG, response);


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


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


import static org.junit.Assert.fail;

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


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


    @Test
    @Test