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

Commit 0faed214 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7947231 from 1a8d6971 to sc-v2-release

Change-Id: If187bf41349c59fe005ca80f37d0411f185aedec
parents 942ebb42 1a8d6971
Loading
Loading
Loading
Loading
+203 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ option java_outer_classname = "PersistAtomsProto";

// Holds atoms to store on persist storage in case of power cycle or process crash.
// NOTE: using int64 rather than google.protobuf.Timestamp for timestamps simplifies implementation.
// Next id: 22
// Next id: 50
message PersistAtoms {
    /* Aggregated RAT usage during the call. */
    repeated VoiceCallRatUsage voice_call_rat_usage = 1;
@@ -93,6 +93,84 @@ message PersistAtoms {

    /* Timestamp of last network_requests pull. */
    optional int64 network_requests_pull_timestamp_millis = 23;

    /* RCS single registrtions feature tag information. */
    repeated ImsRegistrationFeatureTagStats ims_registration_feature_tag_stats = 24;

    /* Timestamp of last ims_registration_feature_tag_stats pull. */
    optional int64 ims_registration_feature_tag_stats_pull_timestamp_millis = 25;

    /* RCS client provisioning statistics and information. */
    repeated RcsClientProvisioningStats rcs_client_provisioning_stats = 26;

    /* Timestamp of last rcs_client_provisioning_stats pull. */
    optional int64 rcs_client_provisioning_stats_pull_timestamp_millis = 27;

    /* RCS configuration statistics and information based ACS. */
    repeated RcsAcsProvisioningStats rcs_acs_provisioning_stats = 28;

    /* Timestamp of last rcs_acs_provisioning_stats pull. */
    optional int64 rcs_acs_provisioning_stats_pull_timestamp_millis = 29;

    /* SIP delegate statistics and information. */
    repeated SipDelegateStats sip_delegate_stats = 30;

    /* Timestamp of last sip_delegate_stats pull. */
    optional int64 sip_delegate_stats_pull_timestamp_millis = 31;

    /* SIP Transport featuere tag statistics and information. */
    repeated SipTransportFeatureTagStats sip_transport_feature_tag_stats = 32;

    /* Timestamp of last sip_transport_feature_tag_stats pull. */
    optional int64 sip_transport_feature_tag_stats_pull_timestamp_millis = 33;

    /* SIP Message response statistics and information. */
    repeated SipMessageResponse sip_message_response = 34;

    /* Timestamp of last sip_message_response pull. */
    optional int64 sip_message_response_pull_timestamp_millis = 35;

    /* SIP Transport session statistics and information. */
    repeated SipTransportSession sip_transport_session = 36;

    /* Timestamp of last sip_transport_session pull. */
    optional int64 sip_transport_session_pull_timestamp_millis = 37;

    /* Dedicated bearer listener statistics and information. */
    repeated ImsDedicatedBearerListenerEvent ims_dedicated_bearer_listener_event = 38;

    /* Timestamp of last ims_dedicated_bearer_listener_event pull. */
    optional int64 ims_dedicated_bearer_listener_event_pull_timestamp_millis = 39;

    /* Dedicated bearer event statistics and information. */
    repeated ImsDedicatedBearerEvent ims_dedicated_bearer_event = 40;

    /* Timestamp of last ims_dedicated_bearer_event pull. */
    optional int64 ims_dedicated_bearer_event_pull_timestamp_millis = 41;

    /* Publish featere tag statistics and information. */
    repeated ImsRegistrationServiceDescStats ims_registration_service_desc_stats = 42;

    /* Timestamp of last ims_registration_service_desc_stats pull. */
    optional int64 ims_registration_service_desc_stats_pull_timestamp_millis = 43;

    /* UCE event stats statistics and information. */
    repeated UceEventStats uce_event_stats = 44;

    /* Timestamp of last uce_event_stats pull. */
    optional int64 uce_event_stats_pull_timestamp_millis = 45;

    /* Presence notify event statistics and information. */
    repeated PresenceNotifyEvent presence_notify_event = 46;

    /* Timestamp of last presence_notify_event pull. */
    optional int64 presence_notify_event_pull_timestamp_millis = 47;

    /* GBA event statistics and information. */
    repeated GbaEvent gba_event = 48;

    /* Timestamp of last gba_event pull. */
    optional int64 gba_event_pull_timestamp_millis = 49;
}

// The canonical versions of the following enums live in:
@@ -273,3 +351,127 @@ message NetworkRequests {
    optional int32 enterprise_request_count = 2;
    optional int32 enterprise_release_count = 3;
}

message ImsRegistrationFeatureTagStats {
    optional int32 carrier_id = 1;
    optional int32 slot_id = 2;
    optional int32 feature_tag_name = 3;
    optional int32 registration_tech = 4;
    optional int64 registered_millis = 5;
}

message RcsClientProvisioningStats {
    optional int32 carrier_id = 1;
    optional int32 slot_id = 2;
    optional int32 event = 3;
    optional int32 count = 4;
}

message RcsAcsProvisioningStats {
    optional int32 carrier_id = 1;
    optional int32 slot_id = 2;
    optional int32 response_code = 3;
    optional int32 response_type = 4;
    optional bool is_single_registration_enabled = 5;
    optional int32 count = 6;
    optional int64 state_timer_millis = 7;
}

message SipDelegateStats {
    optional int32 dimension = 1;
    optional int32 carrier_id = 2;
    optional int32 slot_id = 3;
    optional int32 destroy_reason = 4;
    optional int64 uptime_millis = 5;
}

message SipTransportFeatureTagStats {
    optional int32 carrier_id = 1;
    optional int32 slot_id = 2;
    optional int32 feature_tag_name = 3;
    optional int32 sip_transport_denied_reason = 4;
    optional int32 sip_transport_deregistered_reason = 5;
    optional int64 associated_millis = 6;
}

message SipMessageResponse {
    optional int32 carrier_id = 1;
    optional int32 slot_id = 2;
    optional int32 sip_message_method = 3;
    optional int32 sip_message_response = 4;
    optional int32 sip_message_direction = 5;
    optional int32 message_error = 6;
    optional int32 count = 7;
}

message SipTransportSession {
    optional int32 carrier_id = 1;
    optional int32 slot_id = 2;
    optional int32 session_method = 3;
    optional int32 sip_message_direction = 4;
    optional int32 sip_response = 5;
    optional int32 session_count = 6;
    optional int32 ended_gracefully_count = 7;

    // Internal use only
    optional bool is_ended_gracefully = 10001;
}

message ImsDedicatedBearerListenerEvent {
    optional int32 carrier_id = 1;
    optional int32 slot_id = 2;
    optional int32 rat_at_end = 3;
    optional int32 qci = 4;
    optional bool dedicated_bearer_established = 5;
    optional int32 event_count = 6;
}

message ImsDedicatedBearerEvent {
    optional int32 carrier_id = 1;
    optional int32 slot_id = 2;
    optional int32 rat_at_end = 3;
    optional int32 qci = 4;
    optional int32 bearer_state = 5;
    optional bool local_connection_info_received = 6;
    optional bool remote_connection_info_received = 7;
    optional bool has_listeners = 8;
    optional int32 count = 9;
}

message ImsRegistrationServiceDescStats {
    optional int32 carrier_id = 1;
    optional int32 slot_id = 2;
    optional int32 service_id_name = 3;
    optional float service_id_version = 4;
    optional int32 registration_tech = 5;
    optional int64 published_millis = 6;
}

message UceEventStats {
    optional int32 carrier_id = 1;
    optional int32 slot_id = 2;
    optional int32 type = 3;
    optional bool successful = 4;
    optional int32 command_code = 5;
    optional int32 network_response = 6;
    optional int32 count = 7;
}

message PresenceNotifyEvent {
    optional int32 carrier_id = 1;
    optional int32 slot_id = 2;
    optional int32 reason = 3;
    optional bool content_body_received = 4;
    optional int32 rcs_caps_count = 5;
    optional int32 mmtel_caps_count = 6;
    optional int32 no_caps_count = 7;
    optional int32 count = 8;
}

message GbaEvent {
    optional int32 carrier_id = 1;
    optional int32 slot_id = 2;
    optional bool successful = 3;
    optional int32 failed_reason = 4;
    optional int32 count = 5;
}
 No newline at end of file
+9 −2
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.text.TextUtils;
import android.util.SparseArray;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.metrics.RcsStats;
import com.android.telephony.Rlog;

import java.util.concurrent.ConcurrentLinkedQueue;
@@ -60,6 +61,7 @@ public class GbaManager {
    public static final int MAX_RETRY = 5;
    @VisibleForTesting
    public static final int REQUEST_TIMEOUT_MS = 5000;
    private final RcsStats mRcsStats;

    private final String mLogTag;
    private final Context mContext;
@@ -191,7 +193,8 @@ public class GbaManager {
    }

    @VisibleForTesting
    public GbaManager(Context context, int subId, String servicePackageName, int releaseTime) {
    public GbaManager(Context context, int subId, String servicePackageName, int releaseTime,
            RcsStats rcsStats) {
        mContext = context;
        mSubId = subId;
        mLogTag = "GbaManager[" + subId + "]";
@@ -206,6 +209,7 @@ public class GbaManager {
        if (mReleaseTime < 0) {
            mHandler.sendEmptyMessage(EVENT_BIND_SERVICE);
        }
        mRcsStats = rcsStats;
    }

    /**
@@ -213,7 +217,8 @@ public class GbaManager {
     */
    public static GbaManager make(Context context, int subId,
            String servicePackageName, int releaseTime) {
        GbaManager gm = new GbaManager(context, subId, servicePackageName, releaseTime);
        GbaManager gm = new GbaManager(context, subId, servicePackageName, releaseTime,
                RcsStats.getInstance());
        synchronized (sGbaManagers) {
            sGbaManagers.put(subId, gm);
        }
@@ -267,6 +272,7 @@ public class GbaManager {
                    if (cb != null) {
                        try {
                            cb.onKeysAvailable(token, gbaKey, btId);
                            mRcsStats.onGbaSuccessEvent(mSubId);
                        } catch (RemoteException exception) {
                            logd("RemoteException " + exception);
                        }
@@ -291,6 +297,7 @@ public class GbaManager {
                    if (cb != null) {
                        try {
                            cb.onAuthenticationFailure(token, reason);
                            mRcsStats.onGbaFailureEvent(mSubId, reason);
                        } catch (RemoteException exception) {
                            logd("RemoteException " + exception);
                        }
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ public class DcNetworkAgent extends NetworkAgent {
        } else {
            loge("The connection does not have a valid link properties.");
        }
        mQosCallbackTracker = new QosCallbackTracker(this);
        mQosCallbackTracker = new QosCallbackTracker(this, mPhone.getPhoneId());
    }

    private @NetworkType int getNetworkType() {
+127 −3
Original line number Diff line number Diff line
@@ -17,16 +17,18 @@
package com.android.internal.telephony.dataconnection;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.net.LinkAddress;
import android.net.QosSession;
import android.telephony.TelephonyProtoEnums;
import android.telephony.data.EpsBearerQosSessionAttributes;
import android.telephony.data.EpsQos;
import android.telephony.data.NrQos;
import android.telephony.data.EpsBearerQosSessionAttributes;
import android.telephony.data.NrQosSessionAttributes;
import android.telephony.data.QosBearerFilter;
import android.telephony.data.QosBearerSession;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.metrics.RcsStats;
import com.android.telephony.Rlog;

import java.net.InetAddress;
@@ -44,21 +46,48 @@ import java.util.Map;
 * {@hide}
 */
public class QosCallbackTracker {
    private static final int DedicatedBearerEvent_STATE_NONE = 0;
    private static final int DedicatedBearerEvent_STATE_ADDED = 1;
    private static final int DedicatedBearerEvent_STATE_MODIFIED = 2;
    private static final int DedicatedBearerEvent_STATE_DELETED = 3;

    @NonNull private final String mTag;
    @NonNull private final DcNetworkAgent mDcNetworkAgent;
    @NonNull private final Map<Integer, QosBearerSession> mQosBearerSessions;
    @NonNull private final RcsStats mRcsStats;

    // We perform an exact match on the address
    @NonNull private final Map<Integer, IFilter> mCallbacksToFilter;

    @NonNull private final int mPhoneID;

    /**
     * Construct a new tracker
     * @param dcNetworkAgent the network agent to send events to
     */
    public QosCallbackTracker(@NonNull final DcNetworkAgent dcNetworkAgent,
            @NonNull final int phoneID) {
        mQosBearerSessions = new HashMap<>();
        mCallbacksToFilter = new HashMap<>();
        mDcNetworkAgent = dcNetworkAgent;
        mPhoneID = phoneID;
        mRcsStats = RcsStats.getInstance();
        mTag = "QosCallbackTracker" + "-" + mDcNetworkAgent.getNetwork().getNetId();
    }

    /**
     * Construct a new tracker
     * @param dcNetworkAgent the network agent to send events to
     * @param rcsStats metrics package to store QoS event info
     */
    public QosCallbackTracker(@NonNull final DcNetworkAgent dcNetworkAgent) {
    @VisibleForTesting
    public QosCallbackTracker(@NonNull final DcNetworkAgent dcNetworkAgent,
            @NonNull final int phoneID, @NonNull final RcsStats rcsStats) {
        mQosBearerSessions = new HashMap<>();
        mCallbacksToFilter = new HashMap<>();
        mDcNetworkAgent = dcNetworkAgent;
        mPhoneID = phoneID;
        mRcsStats = rcsStats;
        mTag = "QosCallbackTracker" + "-" + mDcNetworkAgent.getNetwork().getNetId();
    }

@@ -77,6 +106,8 @@ public class QosCallbackTracker {
        for (final QosBearerSession session : mQosBearerSessions.values()) {
            if (doFiltersMatch(session, filter)) {
                sendSessionAvailable(callbackId, session, filter);

                notifyMetricDedicatedBearerListenerAdded(callbackId, session);
            }
        }
    }
@@ -89,6 +120,7 @@ public class QosCallbackTracker {
    public void removeFilter(final int callbackId) {
        logd("removeFilter: callbackId=" + callbackId);
        mCallbacksToFilter.remove(callbackId);
        notifyMetricDedicatedBearerListenerRemoved(callbackId);
    }

    /**
@@ -98,6 +130,8 @@ public class QosCallbackTracker {
     */
    public void updateSessions(@NonNull final List<QosBearerSession> sessions) {
        logd("updateSessions: sessions size=" + sessions.size());

        int bearerState = DedicatedBearerEvent_STATE_NONE;
        final List<QosBearerSession> sessionsToAdd = new ArrayList<>();
        final Map<Integer, QosBearerSession> incomingSessions = new HashMap<>();
        for (final QosBearerSession incomingSession : sessions) {
@@ -115,6 +149,8 @@ public class QosCallbackTracker {
                if (!existingSessionMatch && incomingSessionMatch) {
                    // The filter matches now and didn't match earlier
                    sendSessionAvailable(callbackId, incomingSession, filter);

                    bearerState = DedicatedBearerEvent_STATE_ADDED;
                }

                if (existingSessionMatch && incomingSessionMatch) {
@@ -122,8 +158,11 @@ public class QosCallbackTracker {
                    // the callback still needs to be notified
                    if (!incomingSession.getQos().equals(existingSession.getQos())) {
                        sendSessionAvailable(callbackId, incomingSession, filter);
                        bearerState = DedicatedBearerEvent_STATE_MODIFIED;
                    }
                }

                notifyMetricDedicatedBearerEvent(incomingSession, filter, bearerState);
            }
            sessionsToAdd.add(incomingSession);
        }
@@ -136,7 +175,9 @@ public class QosCallbackTracker {
                    final IFilter filter = mCallbacksToFilter.get(callbackId);
                    // The filter matches which means it was previously available, and now is lost
                    if (doFiltersMatch(existingSession, filter)) {
                        bearerState = DedicatedBearerEvent_STATE_DELETED;
                        sendSessionLost(callbackId, existingSession);
                        notifyMetricDedicatedBearerEvent(existingSession, filter, bearerState);
                    }
                }
                sessionsToRemove.add(existingSession.getQosBearerSessionId());
@@ -262,6 +303,9 @@ public class QosCallbackTracker {
                    callbackId, session.getQosBearerSessionId(), nrQosAttr);
        }

        /** added to notify to Metric for passing DedicatedBearerEstablished info */
        notifyMetricDedicatedBearerListenerBearerUpdateSession(callbackId, session);

        logd("sendSessionAvailable, callbackId=" + callbackId);
    }

@@ -272,6 +316,86 @@ public class QosCallbackTracker {
        logd("sendSessionLost, callbackId=" + callbackId);
    }

    private void notifyMetricDedicatedBearerListenerAdded(
            final int callbackId, final QosBearerSession session) {

        final int slotId = mPhoneID;
        final int rat = getRatInfoFromSessionInfo(session);
        final int qci = getQCIFromSessionInfo(session);

        mRcsStats.onImsDedicatedBearerListenerAdded(callbackId, slotId, rat, qci);
    }

    private void notifyMetricDedicatedBearerListenerBearerUpdateSession(
            final int callbackId, final QosBearerSession session) {

        final int slotId = mPhoneID;
        final int rat = getRatInfoFromSessionInfo(session);
        final int qci = getQCIFromSessionInfo(session);

        mRcsStats.onImsDedicatedBearerListenerUpdateSession(callbackId, slotId, rat, qci, true);
    }

    private void notifyMetricDedicatedBearerListenerRemoved(final int callbackId) {
        mRcsStats.onImsDedicatedBearerListenerRemoved(callbackId);
    }

    private int getQCIFromSessionInfo(final QosBearerSession session) {
        if (session.getQos() instanceof EpsQos) {
            return ((EpsQos) session.getQos()).getQci();
        } else if (session.getQos() instanceof NrQos) {
            return ((NrQos) session.getQos()).get5Qi();
        }

        return 0;
    }

    private int getRatInfoFromSessionInfo(final QosBearerSession session) {
        if (session.getQos() instanceof EpsQos) {
            return TelephonyProtoEnums.NETWORK_TYPE_LTE;
        } else if (session.getQos() instanceof NrQos) {
            return TelephonyProtoEnums.NETWORK_TYPE_NR;
        }

        return 0;
    }

    private void notifyMetricDedicatedBearerEvent(final QosBearerSession session,
            final IFilter filter, final int bearerState) {

        final int slotId = mPhoneID;
        int ratAtEnd = 0;
        int qci = 0;
        boolean localConnectionInfoReceived = false;
        boolean remoteConnectionInfoReceived = false;


        QosBearerFilter qosBearerFilter = getMatchingQosBearerFilter(session, filter);
        if (session.getQos() instanceof EpsQos) {
            ratAtEnd = TelephonyProtoEnums.NETWORK_TYPE_LTE;
            qci = ((EpsQos) session.getQos()).getQci();
        } else if (session.getQos() instanceof NrQos) {
            ratAtEnd = TelephonyProtoEnums.NETWORK_TYPE_NR;
            qci = ((NrQos) session.getQos()).get5Qi();
        } else {
            return;
        }

        if (qosBearerFilter != null) {
            if (!qosBearerFilter.getLocalAddresses().isEmpty()
                    && qosBearerFilter.getLocalPortRange().isValid()) {
                localConnectionInfoReceived = true;
            }
            if (!qosBearerFilter.getRemoteAddresses().isEmpty()
                    && qosBearerFilter.getRemotePortRange().isValid()) {
                remoteConnectionInfoReceived = true;
            }
        }

        mRcsStats.onImsDedicatedBearerEvent(slotId, ratAtEnd, qci, bearerState,
                localConnectionInfoReceived, remoteConnectionInfoReceived, true);
    }

    public interface IFilter {
        public boolean matchesLocalAddress(InetAddress address, int startPort, int endPort);
        public boolean matchesRemoteAddress(InetAddress address, int startPort, int endPort);
Loading