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

Commit 64928c72 authored by Jayachandran C's avatar Jayachandran C
Browse files

Data stall recovery attempts notification

Send an intent to notify the data stall recovery attempts.

Test: Manual
Bug: 77293796
Change-Id: Id565c42dc30db66deec339828d237d6c7e8473f3
parent a43d71d6
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,