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

Commit e6184835 authored by Willy Hu's avatar Willy Hu Committed by Android (Google) Code Review
Browse files

Merge "[DSRM] Store the duration of current action" into udc-dev

parents 1a448079 dfcbce20
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -175,6 +175,8 @@ public class DataStallRecoveryManager extends Handler {
    private boolean mIsAttemptedAllSteps;
    /** Whether internet network connected. */
    private boolean mIsInternetNetworkConnected;
    /** The durations for current recovery action */
    private @ElapsedRealtimeLong long mTimeElapsedOfCurrentAction;

    /** The array for the timers between recovery actions. */
    private @NonNull long[] mDataStallRecoveryDelayMillisArray;
@@ -467,6 +469,15 @@ public class DataStallRecoveryManager extends Handler {
        return (SystemClock.elapsedRealtime() - mTimeLastRecoveryStartMs);
    }

    /**
     * Get duration time for current recovery action.
     *
     * @return the time duration for current recovery action.
     */
    private long getDurationOfCurrentRecoveryMs() {
        return (SystemClock.elapsedRealtime() - mTimeElapsedOfCurrentAction);
    }

    /**
     * Broadcast intent when data stall occurred.
     *
@@ -594,6 +605,7 @@ public class DataStallRecoveryManager extends Handler {
    private void setNetworkValidationState(boolean isValid) {
        boolean isLogNeeded = false;
        int timeDuration = 0;
        int timeDurationOfCurrentAction = 0;
        boolean isFirstDataStall = false;
        boolean isFirstValidationAfterDoRecovery = false;
        @RecoveredReason int reason = getRecoveredReason(isValid);
@@ -626,9 +638,11 @@ public class DataStallRecoveryManager extends Handler {
        }

        if (isLogNeeded) {
            timeDurationOfCurrentAction =
                (isFirstDataStall == true ? 0 : (int) getDurationOfCurrentRecoveryMs());
            DataStallRecoveryStats.onDataStallEvent(
                    mLastAction, mPhone, isValid, timeDuration, reason,
                    isFirstValidationAfterDoRecovery);
                    isFirstValidationAfterDoRecovery, timeDurationOfCurrentAction);
            logl(
                    "data stall: "
                    + (isFirstDataStall == true ? "start" : isValid == false ? "in process" : "end")
@@ -641,7 +655,9 @@ public class DataStallRecoveryManager extends Handler {
                    + ", isFirstValidationAfterDoRecovery="
                    + isFirstValidationAfterDoRecovery
                    + ", TimeDuration="
                    + timeDuration);
                    + timeDuration
                    + ", TimeDurationForCurrentRecoveryAction="
                    + timeDurationOfCurrentAction);
        }
    }

@@ -692,6 +708,7 @@ public class DataStallRecoveryManager extends Handler {
        mLastActionReported = false;
        broadcastDataStallDetected(recoveryAction);
        mNetworkCheckTimerStarted = false;
        mTimeElapsedOfCurrentAction = SystemClock.elapsedRealtime();

        switch (recoveryAction) {
            case RECOVERY_ACTION_GET_DATA_CALL_LIST:
+4 −2
Original line number Diff line number Diff line
@@ -62,7 +62,8 @@ public class DataStallRecoveryStats {
            boolean isRecovered,
            int durationMillis,
            @DataStallRecoveryManager.RecoveredReason int reason,
            boolean isFirstValidation) {
            boolean isFirstValidation,
            int durationMillisOfCurrentAction) {
        if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
            phone = phone.getDefaultPhone();
        }
@@ -131,7 +132,8 @@ public class DataStallRecoveryStats {
                otherNetworkRegState,
                phoneNetworkRegState,
                isFirstValidation,
                phoneId);
                phoneId,
                durationMillisOfCurrentAction);
    }

    /** Returns the RAT used for data (including IWLAN). */