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

Commit a036b696 authored by Jayachandran Chinnakkannu's avatar Jayachandran Chinnakkannu Committed by Android (Google) Code Review
Browse files

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

parents b992de1c 64928c72
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,8 @@


package com.android.internal.telephony.dataconnection;
package com.android.internal.telephony.dataconnection;


import static android.Manifest.permission.READ_PHONE_STATE;

import android.app.AlarmManager;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.app.ProgressDialog;
@@ -4571,11 +4573,20 @@ public class DcTracker extends Handler {
        if (VDBG_STALL) log("putRecoveryAction: " + action);
        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() {
    private void doRecovery() {
        if (getOverallState() == DctConstants.State.CONNECTED) {
        if (getOverallState() == DctConstants.State.CONNECTED) {
            // Go through a series of recovery steps, each action transitions to the next action
            // Go through a series of recovery steps, each action transitions to the next action
            final int recoveryAction = getRecoveryAction();
            final int recoveryAction = getRecoveryAction();
            TelephonyMetrics.getInstance().writeDataStallEvent(mPhone.getPhoneId(), recoveryAction);
            TelephonyMetrics.getInstance().writeDataStallEvent(mPhone.getPhoneId(), recoveryAction);
            broadcastDataStallDetected(recoveryAction);

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