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

Commit 7d97ddc2 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Expand call forwarding logging.

Cleaned up logging code surrounding call forwarding indication changes.
Diagnosing failures to update the CFI indicator was not possible due
to missing logging.

Test: Manually togged CFI to confirm log messages.
Bug: 65760595
Merged-In: I4d06c842c3d21304e1df719a6d37085781f22e21
Change-Id: I94d546486a08547d0b1958708884b5e1725e322d
parent b7a5be0d
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -16,12 +16,16 @@

package com.android.internal.telephony;

import android.telecom.Log;

/**
 * See also RIL_CallForwardInfo in include/telephony/ril.h
 *
 * {@hide}
 */
public class CallForwardInfo {
    private static final String TAG = "CallForwardInfo";

    public int             status;      /*1 = active, 0 = not active */
    public int             reason;      /* from TS 27.007 7.11 "reason" */
    public int             serviceClass; /* Saum of CommandsInterface.SERVICE_CLASS */
@@ -31,9 +35,9 @@ public class CallForwardInfo {

    @Override
    public String toString() {
        return super.toString() + (status == 0 ? " not active " : " active ")
            + " reason: " + reason
            + " serviceClass: " + serviceClass + " " + timeSeconds + " seconds";

        return "[CallForwardInfo: status=" + (status == 0 ? " not active " : " active ")
                + ", reason= " + reason
                + ", serviceClass= " + serviceClass + ", timeSec= " + timeSeconds + " seconds"
                + ", number=" + Log.pii(number) + "]";
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -125,6 +125,9 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
        int subId = sender.getSubId();
        try {
            if (mRegistry != null) {
                Rlog.d(LOG_TAG, "notifyCallForwardingChanged: subId=" + subId + ", isCFActive="
                        + sender.getCallForwardingIndicator());

                mRegistry.notifyCallForwardingChangedForSubscriber(subId,
                        sender.getCallForwardingIndicator());
            }
+1 −0
Original line number Diff line number Diff line
@@ -2548,6 +2548,7 @@ public class GsmCdmaPhone extends Phone {
    private void processIccRecordEvents(int eventCode) {
        switch (eventCode) {
            case IccRecords.EVENT_CFI:
                logi("processIccRecordEvents: EVENT_CFI");
                notifyCallForwardingIndicator();
                break;
        }
+5 −1
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ import android.telephony.SignalStrength;
import android.telephony.SubscriptionManager;
import android.telephony.VoLteServiceState;
import android.text.TextUtils;
import android.util.Log;

import com.android.ims.ImsCall;
import com.android.ims.ImsConfig;
@@ -1796,7 +1797,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        int status = enable ? IccRecords.CALL_FORWARDING_STATUS_ENABLED :
                IccRecords.CALL_FORWARDING_STATUS_DISABLED;
        int subId = getSubId();
        Rlog.d(LOG_TAG, "setCallForwardingIndicatorInSharedPref: Storing status = " + status +
        Rlog.i(LOG_TAG, "setCallForwardingIndicatorInSharedPref: Storing status = " + status +
                " in pref " + CF_STATUS + subId);

        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
@@ -1838,6 +1839,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        if (callForwardingIndicator == IccRecords.CALL_FORWARDING_STATUS_UNKNOWN) {
            callForwardingIndicator = getCallForwardingIndicatorFromSharedPref();
        }
        Rlog.v(LOG_TAG, "getCallForwardingIndicator: iccForwardingFlag=" + (r != null
                    ? r.getVoiceCallForwardingFlag() : "null") + ", sharedPrefFlag="
                    + getCallForwardingIndicatorFromSharedPref());
        return (callForwardingIndicator == IccRecords.CALL_FORWARDING_STATUS_ENABLED);
    }