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

Commit 6823d057 authored by Jayachandran Chinnakkannu's avatar Jayachandran Chinnakkannu Committed by android-build-merger
Browse files

Merge "Data stall recovery attempts notification" into pi-dev

am: a036b696

Change-Id: Ic285fb1f60b30e6f25047250c4565d434ab81a15
parents 27bab164 a036b696
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.internal.telephony.dataconnection;

import static android.Manifest.permission.READ_PHONE_STATE;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.ProgressDialog;
@@ -4571,11 +4573,20 @@ public class DcTracker extends Handler {
        if (VDBG_STALL) log("putRecoveryAction: " + action);
    }

    private void broadcastDataStallDetected(int recoveryAction) {
        Intent intent = new Intent(TelephonyManager.ACTION_DATA_STALL_DETECTED);
        SubscriptionManager.putPhoneIdAndSubIdExtra(intent, mPhone.getPhoneId());
        intent.putExtra(TelephonyManager.EXTRA_RECOVERY_ACTION, recoveryAction);
        mPhone.getContext().sendBroadcast(intent, READ_PHONE_STATE);
    }

    private void doRecovery() {
        if (getOverallState() == DctConstants.State.CONNECTED) {
            // Go through a series of recovery steps, each action transitions to the next action
            final int recoveryAction = getRecoveryAction();
            TelephonyMetrics.getInstance().writeDataStallEvent(mPhone.getPhoneId(), recoveryAction);
            broadcastDataStallDetected(recoveryAction);

            switch (recoveryAction) {
                case RecoveryAction.GET_DATA_CALL_LIST:
                    EventLog.writeEvent(EventLogTags.DATA_STALL_RECOVERY_GET_DATA_CALL_LIST,