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

Commit 64ba97f0 authored by Jack Yu's avatar Jack Yu
Browse files

Log raw fail cause to metrics

Fix: 267531460
Test: Boot up + Basic phone funcationality tests
Test: atest FrameworksTelephonyTests
Change-Id: I0dc4641dab2bdb64475e83cd130de5cb1ecf6c30
parent d9b3fdc5
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -2446,7 +2446,8 @@ public class DataNetwork extends StateMachine {
                getDataNetworkType(),
                apnTypeBitmask,
                protocol,
                mFailCause);
                // Log the raw fail cause to avoid large amount of UNKNOWN showing on metrics.
                response != null ? response.getCause() : mFailCause);
    }

    /**
@@ -3263,7 +3264,7 @@ public class DataNetwork extends StateMachine {
            mDataNetworkCallback.invokeFromExecutor(
                    () -> mDataNetworkCallback.onHandoverFailed(DataNetwork.this,
                            mFailCause, retry, handoverFailureMode));
            trackHandoverFailure();
            trackHandoverFailure(response != null ? response.getCause() : mFailCause);
        }

        // No matter handover succeeded or not, transit back to connected state.
@@ -3273,13 +3274,15 @@ public class DataNetwork extends StateMachine {
    /**
     * Called when handover failed. Record the source and target RAT{@link NetworkType} and the
     * failure cause {@link android.telephony.DataFailCause}.
     *
     * @param cause The fail cause.
     */
    private void trackHandoverFailure() {
    private void trackHandoverFailure(int cause) {
        int sourceRat = getDataNetworkType();
        int targetTransport = DataUtils.getTargetTransport(mTransport);
        int targetRat = getDataNetworkType(targetTransport);

        mDataCallSessionStats.onHandoverFailure(mFailCause, sourceRat, targetRat);
        mDataCallSessionStats.onHandoverFailure(cause, sourceRat, targetRat);
    }

    /**
+2 −2
Original line number Diff line number Diff line
@@ -84,14 +84,14 @@ public class DataCallSessionStats {
     * @param currentRat The data call current Network Type
     * @param apnTypeBitmask APN type bitmask
     * @param protocol Data connection protocol
     * @param failureCause failure cause as per android.telephony.DataFailCause
     * @param failureCause The raw failure cause from modem/IWLAN data service.
     */
    public synchronized void onSetupDataCallResponse(
            @Nullable DataCallResponse response,
            @NetworkType int currentRat,
            @ApnType int apnTypeBitmask,
            @ProtocolType int protocol,
            @DataFailureCause int failureCause) {
            int failureCause) {
        // there should've been a call to onSetupDataCall to initiate the atom,
        // so this method is being called out of order -> no metric will be logged
        if (mDataCallSession == null) {