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

Commit 616c945b authored by Kiwon Park's avatar Kiwon Park Committed by Automerger Merge Worker
Browse files

Merge "Populate carrier id in anomaly reports." into tm-dev am: 20b28bf9

parents e5446396 20b28bf9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -405,7 +405,7 @@ public class CarrierServicesSmsFilter {
                            .map(callback -> callback.mPackageName)
                            .collect(Collectors.joining(", "));
                    AnomalyReporter.reportAnomaly(sAnomalyNoResponseFromCarrierMessagingService,
                            "No response from " + packages);
                            "No response from " + packages, mPhone.getCarrierId());
                    handleFilterCallbacksTimeout();
                    break;
            }
+10 −7
Original line number Diff line number Diff line
@@ -426,7 +426,8 @@ public class CellularNetworkService extends NetworkService {
            final int reasonForDenial = regResult.reasonForDenial;

            int networkType = ServiceState.rilRadioTechnologyToNetworkType(regResult.rat);
            networkType = getNetworkTypeForCellIdentity(networkType, cellIdentity);
            networkType =
                    getNetworkTypeForCellIdentity(networkType, cellIdentity, mPhone.getCarrierId());

            // Conditional parameters for specific RANs
            boolean cssSupported = false;
@@ -578,7 +579,8 @@ public class CellularNetworkService extends NetworkService {
            final int reasonForDenial = regResult.reasonForDenial;

            int networkType = ServiceState.rilRadioTechnologyToNetworkType(regResult.rat);
            networkType = getNetworkTypeForCellIdentity(networkType, cellIdentity);
            networkType =
                    getNetworkTypeForCellIdentity(networkType, cellIdentity, mPhone.getCarrierId());

            // Conditional parameters for specific RANs
            boolean cssSupported = false;
@@ -682,13 +684,14 @@ public class CellularNetworkService extends NetworkService {

    /** Cross-check the network type against the CellIdentity type */
    @VisibleForTesting
    public static int getNetworkTypeForCellIdentity(int networkType, CellIdentity ci) {
    public static int getNetworkTypeForCellIdentity(
            int networkType, CellIdentity ci, int carrierId) {
        if (ci == null) {
            if (networkType != TelephonyManager.NETWORK_TYPE_UNKNOWN) {
                // Network type is non-null but CellIdentity is null
                AnomalyReporter.reportAnomaly(
                        UUID.fromString("e67ea4ef-7251-4a69-a063-22c47fc58743"),
                            "RIL Unexpected NetworkType");
                            "RIL Unexpected NetworkType", carrierId);
                if (android.os.Build.isDebuggable()) {
                    logw("Updating incorrect network type from "
                            + TelephonyManager.getNetworkTypeName(networkType) + " to UNKNOWN");
@@ -712,7 +715,7 @@ public class CellularNetworkService extends NetworkService {
        if (networkType == TelephonyManager.NETWORK_TYPE_IWLAN) {
            AnomalyReporter.reportAnomaly(
                    UUID.fromString("07dfa183-b2e7-42b7-98a1-dd5ae2abdd4f"),
                            "RIL Reported IWLAN");
                            "RIL Reported IWLAN", carrierId);
            if (!android.os.Build.isDebuggable()) return networkType;

            if (sNetworkTypes.containsKey(ci.getClass())) {
@@ -728,7 +731,7 @@ public class CellularNetworkService extends NetworkService {
        if (!sNetworkTypes.containsKey(ci.getClass())) {
            AnomalyReporter.reportAnomaly(
                    UUID.fromString("469858cf-46e5-416e-bc11-5e7970917857"),
                        "RIL Unknown CellIdentity");
                        "RIL Unknown CellIdentity", carrierId);
            return networkType;
        }

@@ -737,7 +740,7 @@ public class CellularNetworkService extends NetworkService {
        if (!typesForCi.contains(networkType)) {
            AnomalyReporter.reportAnomaly(
                    UUID.fromString("2fb634fa-cab3-44d2-bbe8-c7689b0f3e31"),
                        "RIL Mismatched NetworkType");
                        "RIL Mismatched NetworkType", carrierId);
            // Since this is a plain-and-simple mismatch between two conflicting pieces of
            // data, and theres no way to know which one to trust, pick the one that's harder
            // to coerce / fake / set incorrectly and make them roughly match.
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ public class DisplayInfoController extends Handler {
        } catch (InvalidArgumentException e) {
            logel(e.getMessage());
            AnomalyReporter.reportAnomaly(UUID.fromString("3aa92a2c-94ed-46a0-a744-d6b1dfec2a55"),
                    e.getMessage());
                    e.getMessage(), mPhone.getCarrierId());
        }
    }

+6 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.internal.telephony;

import static android.telephony.TelephonyManager.UNKNOWN_CARRIER_ID;

import android.content.Context;
import android.hardware.radio.V1_0.RadioError;
import android.provider.Settings;
@@ -132,10 +134,13 @@ public class RadioBugDetector {
                    RADIO_BUG_REPETITIVE_WAKELOCK_TIMEOUT_ERROR;
            String message = "Repeated radio error " + mRadioBugStatus + " on slot " + mSlotId;
            Rlog.d(TAG, message);

            Phone phone = PhoneFactory.getPhone(mSlotId);
            int carrierId = phone == null ? UNKNOWN_CARRIER_ID : phone.getCarrierId();
            // Using fixed UUID to avoid duplicate bugreport notification
            AnomalyReporter.reportAnomaly(
                    UUID.fromString("d264ead0-3f05-11ea-b77f-2e728ce88125"),
                    message);
                    message, carrierId);
        }
    }

+11 −3
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.internal.telephony;

import static android.telephony.TelephonyManager.UNKNOWN_CARRIER_ID;

import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CALL_RING;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CARRIER_INFO_IMSI_ENCRYPTION;
import static com.android.internal.telephony.RILConstants.RIL_UNSOL_CDMA_CALL_WAITING;
@@ -1114,7 +1116,7 @@ public class RadioIndication extends IRadioIndication.Stub {
                || (domain & ~NetworkRegistrationInfo.DOMAIN_CS_PS) != 0
                || causeCode < 0 || additionalCauseCode < 0
                || (causeCode == Integer.MAX_VALUE && additionalCauseCode == Integer.MAX_VALUE)) {
            AnomalyReporter.reportAnomaly(
            reportAnomaly(
                    UUID.fromString("f16e5703-6105-4341-9eb3-e68189156eb4"),
                            "Invalid registrationFailed indication");

@@ -1140,7 +1142,7 @@ public class RadioIndication extends IRadioIndication.Stub {
        mRil.processIndication(RIL.RADIO_SERVICE, indicationType);

        if (cellIdentity == null || barringInfos == null) {
            AnomalyReporter.reportAnomaly(
            reportAnomaly(
                    UUID.fromString("645b16bb-c930-4c1c-9c5d-568696542e05"),
                            "Invalid barringInfoChanged indication");

@@ -1238,7 +1240,7 @@ public class RadioIndication extends IRadioIndication.Stub {
                }
            }
        } catch (IllegalArgumentException iae) {
            AnomalyReporter.reportAnomaly(UUID.fromString("918f0970-9aa9-4bcd-a28e-e49a83fe77d5"),
            reportAnomaly(UUID.fromString("918f0970-9aa9-4bcd-a28e-e49a83fe77d5"),
                    "RIL reported invalid PCC (HIDL)");
            mRil.riljLoge("Invalid PhysicalChannelConfig " + iae);
            return;
@@ -1323,4 +1325,10 @@ public class RadioIndication extends IRadioIndication.Stub {
        mRil.mApnUnthrottledRegistrants.notifyRegistrants(
                new AsyncResult(null, apn, null));
    }

    private void reportAnomaly(UUID uuid, String msg) {
        Phone phone = mRil.mPhoneId == null ? null : PhoneFactory.getPhone(mRil.mPhoneId);
        int carrierId = phone == null ? UNKNOWN_CARRIER_ID : phone.getCarrierId();
        AnomalyReporter.reportAnomaly(uuid, msg, carrierId);
    }
}
Loading