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

Commit 115e8ab3 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
Merged-In: I0dc4641dab2bdb64475e83cd130de5cb1ecf6c30
Change-Id: I0dc4641dab2bdb64475e83cd130de5cb1ecf6c30
parent a2fb5af7
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -2481,7 +2481,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);
    }

    /**
@@ -3295,7 +3296,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.
@@ -3305,13 +3306,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
@@ -81,14 +81,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) {