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

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

Merge "Add metrics for AutoDataSwitch" into tm-qpr-dev-plus-aosp

parents 9200ea70 ae61e0f1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -305,6 +305,7 @@ message DataCallSession {
    optional int32 band_at_end = 19;
    repeated int32 handover_failure_causes = 20;
    repeated int32 handover_failure_rat = 21;
    optional bool is_non_dds = 22;
}

message CellularServiceState {
@@ -517,3 +518,9 @@ message UnmeteredNetworks {
    optional int32 carrier_id = 2;
    optional int64 unmetered_networks_bitmask = 3;
}

message OutgoingShortCodeSms {
    optional int32 category = 1;
    optional int32 xml_version = 2;
    optional int32 short_code_sms_count = 3;
}
+14 −0
Original line number Diff line number Diff line
@@ -29,7 +29,9 @@ import android.telephony.Annotation.DataFailureCause;
import android.telephony.Annotation.NetworkType;
import android.telephony.DataFailCause;
import android.telephony.ServiceState;
import android.telephony.SubscriptionInfo;
import android.telephony.TelephonyManager;
import android.telephony.data.ApnSetting;
import android.telephony.data.ApnSetting.ProtocolType;
import android.telephony.data.DataCallResponse;
import android.telephony.data.DataService;
@@ -257,6 +259,16 @@ public class DataCallSessionStats {
    private void endDataCallSession() {
        mDataCallSession.oosAtEnd = getIsOos();
        mDataCallSession.ongoing = false;
        // set if this data call is established for internet on the non-Dds
        SubscriptionInfo subInfo = SubscriptionController.getInstance()
                .getSubscriptionInfo(mPhone.getSubId());
        if (mPhone.getSubId() != SubscriptionController.getInstance().getDefaultDataSubId()
                && ((mDataCallSession.apnTypeBitmask & ApnSetting.TYPE_DEFAULT)
                == ApnSetting.TYPE_DEFAULT)
                && subInfo != null && !subInfo.isOpportunistic()) {
            mDataCallSession.isNonDds = true;
        }

        // store for the data call list event, after DataCall is disconnected and entered into
        // inactive mode
        PhoneFactory.getMetricsCollector().unregisterOngoingDataCallStat(this);
@@ -292,6 +304,7 @@ public class DataCallSessionStats {
                call.handoverFailureCauses.length);
        copy.handoverFailureRat = Arrays.copyOf(call.handoverFailureRat,
                call.handoverFailureRat.length);
        copy.isNonDds = call.isNonDds;
        return copy;
    }

@@ -316,6 +329,7 @@ public class DataCallSessionStats {
        proto.ongoing = true;
        proto.handoverFailureCauses = new int[0];
        proto.handoverFailureRat = new int[0];
        proto.isNonDds = false;
        return proto;
    }

+26 −1
Original line number Diff line number Diff line
@@ -16,12 +16,16 @@

package com.android.internal.telephony.metrics;

import android.telephony.AccessNetworkConstants;
import android.telephony.Annotation.NetworkType;
import android.telephony.CellSignalStrength;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.ServiceState;
import android.telephony.TelephonyManager;

import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.ServiceStateTracker;
import com.android.internal.telephony.SubscriptionController;
import com.android.internal.telephony.TelephonyStatsLog;
@@ -74,6 +78,25 @@ public class DataStallRecoveryStats {
            recoveryAction = RECOVERY_ACTION_RESET_MODEM_MAPPING;
        }

        // collect info of the other device in case of DSDS
        int otherSignalStrength = CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
        // the number returned here matches the NetworkRegistrationState enum we have
        int otherNetworkRegState = NetworkRegistrationInfo
                .REGISTRATION_STATE_NOT_REGISTERED_OR_SEARCHING;
        for (Phone otherPhone : PhoneFactory.getPhones()) {
            if (otherPhone.getPhoneId() == phone.getPhoneId()) continue;
            if (!getIsOpportunistic(otherPhone)) {
                otherSignalStrength = otherPhone.getSignalStrength().getLevel();
                NetworkRegistrationInfo regInfo = otherPhone.getServiceState()
                        .getNetworkRegistrationInfo(NetworkRegistrationInfo.DOMAIN_PS,
                                AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
                if (regInfo != null) {
                    otherNetworkRegState = regInfo.getRegistrationState();
                }
                break;
            }
        }

        TelephonyStatsLog.write(
                TelephonyStatsLog.DATA_STALL_RECOVERY_REPORTED,
                carrierId,
@@ -85,7 +108,9 @@ public class DataStallRecoveryStats {
                band,
                isRecovered,
                durationMillis,
                reason);
                reason,
                otherSignalStrength,
                otherNetworkRegState);
    }

    /** Returns the RAT used for data (including IWLAN). */
+2 −1
Original line number Diff line number Diff line
@@ -830,7 +830,8 @@ public class MetricsCollector implements StatsManager.StatsPullAtomCallback {
                dataCallSession.ongoing,
                dataCallSession.bandAtEnd,
                dataCallSession.handoverFailureCauses,
                dataCallSession.handoverFailureRat);
                dataCallSession.handoverFailureRat,
                dataCallSession.isNonDds);
    }

    private static StatsEvent buildStatsEvent(ImsRegistrationStats stats) {