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

Commit a8767341 authored by Michele Berionne's avatar Michele Berionne Committed by Nazanin Bakhshi
Browse files

Add support for new SMS metrics

Bug: 160807699
Test: manual testing
Change-Id: I2ad81f2728d705912247a0410ca4efce2fd5d3ef
parent 4ecec9c5
Loading
Loading
Loading
Loading
+55 −1
Original line number Diff line number Diff line
@@ -499,7 +499,7 @@ message Atom {
    }

    // Pulled events will start at field 10000.
    // Next: 10084
    // Next: 10087
    oneof pulled {
        WifiBytesTransfer wifi_bytes_transfer = 10000 [(module) = "framework"];
        WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001 [(module) = "framework"];
@@ -598,6 +598,7 @@ message Atom {
        DNDModeProto dnd_mode_rule = 10084 [(module) = "framework"];
        GeneralExternalStorageAccessStats general_external_storage_access_stats =
            10085 [(module) = "mediaprovider"];
        IncomingSms incoming_sms = 10086 [(module) = "telephony"];
    }

    // DO NOT USE field numbers above 100,000 in AOSP.
@@ -10460,6 +10461,59 @@ message SupportedRadioAccessFamily {
    optional int64 network_type_bitmask = 1;
}

/**
 * Pulls information for a single incoming SMS.
 *
 * Each pull creates multiple atoms, one for each SMS. The sequence is randomized when pulled.
 *
 * Pulled from:
 *   frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/MetricsCollector.java
 */
message IncomingSms {
    // Format of the SMS (3GPP or 3GPP2).
    optional android.telephony.SmsFormatEnum sms_format = 1;

    // Technology of the SMS (CS or IMS).
    optional android.telephony.SmsTechEnum sms_tech = 2;

    // Radio access technology (RAT) used for the SMS. It can be IWLAN in case of IMS.
    optional android.telephony.NetworkTypeEnum rat = 3;

    // Type the SMS.
    optional android.telephony.SmsTypeEnum sms_type = 4;

    // Number of total parts.
    optional int32 total_parts = 5;

    // Number of received parts (if smaller than total parts, the SMS was dropped).
    optional int32 received_parts = 6;

    // Indicates if the incoming SMS was blocked.
    optional bool blocked = 7;

    // Indicate a specific error handling the SMS
    optional android.telephony.SmsIncomingErrorEnum error = 8;

    // Whether the SMS was received while roaming.
    optional bool is_roaming = 9;

    // Index of the SIM is used, 0 for single-SIM devices.
    optional int32 sim_slot_index = 10;

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

    // Whether the message was received with an eSIM profile.
    optional bool is_esim = 12;

    // Carrier ID of the SIM card used for the SMS.
    // See https://source.android.com/devices/tech/config/carrierid.
    optional int32 carrier_id = 13;

    // Random message ID.
    optional int64 message_id = 14;
}

/**
 * Logs gnss stats from location service provider
 *
+47 −0
Original line number Diff line number Diff line
@@ -159,3 +159,50 @@ enum SimStateEnum {
     */
    SIM_STATE_PRESENT = 11;
}

// Format of SMS message
enum SmsFormatEnum {
    /** Unknown format */
    SMS_FORMAT_UNKNOWN = 0;
    /** Format compliant with 3GPP TS 23.040 */
    SMS_FORMAT_3GPP = 1;
    /** Format compliant with 3GPP2 TS C.S0015-B */
    SMS_FORMAT_3GPP2 = 2;
}

// Technology used to carry an SMS message
enum SmsTechEnum {
    /**
     * Unknown SMS technology used to carry the SMS.
     * This value is also used for injected SMS.
     */
    SMS_TECH_UNKNOWN = 0;
    /** The SMS was carried over CS bearer in 3GPP network */
    SMS_TECH_CS_3GPP = 1;
    /** The SMS was carried over CS bearer in 3GPP2 network */
    SMS_TECH_CS_3GPP2 = 2;
    /** The SMS was carried over IMS */
    SMS_TECH_IMS = 3;
}

// Types of SMS message
enum SmsTypeEnum {
    /** Normal type. */
    SMS_TYPE_NORMAL = 0;
    /** SMS-PP (point-to-point). */
    SMS_TYPE_SMS_PP = 1;
    /** Voicemail indication. */
    SMS_TYPE_VOICEMAIL_INDICATION = 2;
    /** Type 0 message (3GPP TS 23.040 9.2.3.9). */
    SMS_TYPE_ZERO = 3;
    /** WAP-PUSH message. */
    SMS_TYPE_WAP_PUSH = 4;
}

// SMS errors
enum SmsIncomingErrorEnum {
    SMS_SUCCESS = 0;
    SMS_ERROR_GENERIC = 1;
    SMS_ERROR_NO_MEMORY = 2;
    SMS_ERROR_NOT_SUPPORTED = 3;
}