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

Commit c93ffb42 authored by Nazanin Bakhshi's avatar Nazanin Bakhshi Committed by Android (Google) Code Review
Browse files

Merge "Add support for Data calls metrics"

parents 71826706 b8a04f6b
Loading
Loading
Loading
Loading
+101 −1
Original line number Diff line number Diff line
@@ -497,13 +497,14 @@ message Atom {
        ModemRestart modem_restart = 312 [(module) = "telephony"];
        CarrierIdMismatchEvent carrier_id_mismatch_event = 313 [(module) = "telephony"];
        CarrierIdMatchingTable carrier_id_table_update = 314 [(module) = "telephony"];
        DataStallRecoveryReported data_stall_recovery_reported = 315 [(module) = "telephony"];

        // StatsdStats tracks platform atoms with ids upto 500.
        // Update StatsdStats::kMaxPushedAtomId when atom ids here approach that value.
    }

    // Pulled events will start at field 10000.
    // Next: 10089
    // Next: 10090
    oneof pulled {
        WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
        WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
@@ -605,6 +606,7 @@ message Atom {
        IncomingSms incoming_sms = 10086 [(module) = "telephony"];
        OutgoingSms outgoing_sms = 10087 [(module) = "telephony"];
        CarrierIdMatchingTable carrier_id_table_version = 10088 [(module) = "telephony"];
        DataCallSession data_call_session = 10089 [(module) = "telephony"];
    }

    // DO NOT USE field numbers above 100,000 in AOSP.
@@ -10671,6 +10673,104 @@ message CarrierIdMatchingTable {
    optional int32 table_version = 1;
}

/**
 * Pulls information for a single data call session
 *
 * Each pull creates multiple atoms, one for each data call session.
 * The sequence is randomized when pulled.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message DataCallSession {
    // A random number to be used as dimension to capture multiple atoms
    optional int32 dimension = 1;

    // Whether the device was in multi-SIM mode (with multiple active SIM profiles).
    optional bool is_multi_sim = 2;

    // Whether the call was made with an eSIM profile.
    optional bool is_esim = 3;

    // Data profile of this call (for what purpose this call was made)
    optional android.telephony.DataProfileEnum profile = 4;

    // APN type bitmask of the APN used:
    // @ApnType in frameworks/base/telephony/java/android/telephony/Annotation.java.
    optional int32 apn_type_bitmask = 5;

    // Carrier ID of the SIM
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 6;

    // Whether the subscription is roaming
    optional bool is_roaming = 7;

    // Data RAT when the call ended, can be IWLAN for IMS/MMS, otherwise should be WWAN PS RAT.
    // In the case that the connection hasn't ended yet, this field holds the current RAT.
    // In the case the call ended due to Out Of Service (OOS),
    // this field should be the last known RAT.
    optional android.telephony.NetworkTypeEnum rat_at_end = 8;

    // Was the data call ended due to OOS
    optional bool oos_at_end = 9;

    // Number of RAT switches during the data call
    optional int64 rat_switch_count = 10;

    // Whether the call is on an opportunistic subscription
    optional bool is_opportunistic = 11;

    // Packet data protocol used
    optional android.telephony.ApnProtocolEnum ip_type = 12;

    // Whether the data call terminated before being established
    optional bool setup_failed = 13;

    // Reason why the data call terminated, as in RIL_DataCallFailCause from ril.h
    optional int32 failure_cause = 14;

    // Suggested retry back-off timer value from RIL
    optional int32 suggested_retry_millis = 15;

    // Why the data call was deactivated
    // Set by telephony for MO deactivations (unrelated to failure_cause)
    optional android.telephony.DataDeactivateReasonEnum deactivate_reason = 16;

    // Duration of the data call, rounded into the closest 5 minutes.
    optional int64 duration_minutes = 17;

    // Whether the data call is still connected when the atom is collected.
    optional bool ongoing = 18;
}

/**
 * Logs data stall recovery event
 *
 * Logged from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
 */
message DataStallRecoveryReported {
    // Carrier ID of the SIM
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 1;

    // Data RAT when the stall happened
    optional android.telephony.NetworkTypeEnum rat = 2;

    // Signal strength when stall happened
    optional android.telephony.SignalStrengthEnum signal_strength = 3;

    // Action taken to recover
    optional android.telephony.DataStallRecoveryActionEnum action = 4;

    // Whether the subscription is opportunistic
    optional bool is_opportunistic = 5;

    // Whether the device is in multi-SIM mode
    optional bool is_multi_sim = 6;
}

/**
 * Logs gnss stats from location service provider
 *
+40 −0
Original line number Diff line number Diff line
@@ -220,3 +220,43 @@ enum SmsSendResultEnum {
    // Error over IMS, retry on CS
    SMS_SEND_RESULT_ERROR_FALLBACK = 4;
}

// Data profile of the data call. From
// frameworks/base/telephony/java/com/android/internal/telephony/RILConstants.java
enum DataProfileEnum {
    DATA_PROFILE_INVALID = -1;
    DATA_PROFILE_DEFAULT = 0;
    DATA_PROFILE_TETHERED = 1;
    DATA_PROFILE_IMS = 2;
    DATA_PROFILE_FOTA = 3;
    DATA_PROFILE_CBS = 4;
    DATA_PROFILE_OEM_BASE = 1000;
}

// Reason of data call deactivation. From
// frameworks/base/telephony/java/android/telephony/data/DataService.java#DeactivateDataReason
enum DataDeactivateReasonEnum {
    DEACTIVATE_REASON_UNKNOWN = 0;
    DEACTIVATE_REASON_NORMAL = 1;
    DEACTIVATE_REASON_RADIO_OFF = 2;
    DEACTIVATE_REASON_HANDOVER = 3;
}

// IP type of the data call
// see frameworks/base/telephony/java/android/telephony/data/ApnSetting.java#ProtocolType
enum ApnProtocolEnum {
    APN_PROTOCOL_IPV4 = 0;
    APN_PROTOCOL_IPV6 = 1;
    APN_PROTOCOL_IPV4V6 = 2;
    APN_PROTOCOL_PPP = 3;
}

// Action taken to recover a data call that is stalled. From
// frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
// #RecoveryAction
enum DataStallRecoveryActionEnum {
    RECOVERY_ACTION_GET_DATA_CALL_LIST = 0;
    RECOVERY_ACTION_CLEANUP = 1;
    RECOVERY_ACTION_REREGISTER = 2;
    RECOVERY_ACTION_RADIO_RESTART = 3;
}
 No newline at end of file