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

Commit 52143a05 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add mccmnc for unknown gid1 case in carrier Id metrics" into pi-dev

parents 7dae182f 7549b131
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -568,7 +568,7 @@ public class CarrierIdentifier extends Handler {

        /*
         * Write Carrier Identification Matching event, logging with the
         * carrierId, gid1 and carrier list version to differentiate below cases of metrics:
         * carrierId, mccmnc, gid1 and carrier list version to differentiate below cases of metrics:
         * 1) unknown mccmnc - the Carrier Id provider contains no rule that matches the
         * read mccmnc.
         * 2) the Carrier Id provider contains some rule(s) that match the read mccmnc,
@@ -578,7 +578,8 @@ public class CarrierIdentifier extends Handler {
         */
        String unknownGid1ToLog = ((maxScore & CarrierMatchingRule.SCORE_GID1) == 0
                && !TextUtils.isEmpty(subscriptionRule.mGid1)) ? subscriptionRule.mGid1 : null;
        String unknownMccmncToLog = (maxScore == CarrierMatchingRule.SCORE_INVALID
        String unknownMccmncToLog = ((maxScore == CarrierMatchingRule.SCORE_INVALID
                || (maxScore & CarrierMatchingRule.SCORE_GID1) == 0)
                && !TextUtils.isEmpty(subscriptionRule.mMccMnc)) ? subscriptionRule.mMccMnc : null;
        TelephonyMetrics.getInstance().writeCarrierIdMatchingEvent(
                mPhone.getPhoneId(), getCarrierListVersion(), mCarrierId,
+7 −1
Original line number Diff line number Diff line
@@ -1835,13 +1835,19 @@ public class TelephonyMetrics {
        final CarrierIdMatchingResult carrierIdMatchingResult = new CarrierIdMatchingResult();

        if (cid != TelephonyManager.UNKNOWN_CARRIER_ID) {
            // Successful matching event if result only has carrierId
            carrierIdMatchingResult.carrierId = cid;
            // Unknown Gid1 event if result only has carrierId, gid1 and mccmnc
            if (gid1 != null) {
                carrierIdMatchingResult.mccmnc = mccmnc;
                carrierIdMatchingResult.gid1 = gid1;
            }
        } else {
            // Unknown mccmnc event if result only has mccmnc
            if (mccmnc != null) {
                carrierIdMatchingResult.mccmnc = mccmnc;
            }
        }

        carrierIdMatching.cidTableVersion = version;
        carrierIdMatching.result = carrierIdMatchingResult;
+1 −1
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ public class TelephonyMetricsTest extends TelephonyTest {
        assertEquals(TelephonyEvent.Type.CARRIER_ID_MATCHING, log.events[0].type);
        assertEquals(1, log.events[0].carrierIdMatching.cidTableVersion);
        assertEquals(1, log.events[0].carrierIdMatching.result.carrierId);
        assertTrue(log.events[0].carrierIdMatching.result.mccmnc.isEmpty());
        assertEquals("mccmncTest", log.events[0].carrierIdMatching.result.mccmnc);
        assertEquals("gid1Test", log.events[0].carrierIdMatching.result.gid1);
    }