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

Commit 77a1f167 authored by fionaxu's avatar fionaxu
Browse files

scrub pii in imsphoneconnection + code cleanup

bug: 30368127
Change-Id: I14e8e6de97543786cc7dd327fe4a79f8968ecf04
parent ec15d7bd
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.telephony.Rlog;
import android.util.Log;

import com.android.internal.telephony.uicc.AdnRecord;
import com.android.internal.telephony.uicc.AdnRecordCache;
@@ -42,7 +41,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
public class IccPhoneBookInterfaceManager {
    static final String LOG_TAG = "IccPhoneBookIM";
    protected static final boolean DBG = true;
    protected static final boolean VDBG = Rlog.isLoggable(LOG_TAG, Log.VERBOSE);

    protected Phone mPhone;
    private   UiccCardApplication mCurrentApp = null;
@@ -174,9 +172,9 @@ public class IccPhoneBookInterfaceManager {


        if (DBG) logd("updateAdnRecordsInEfBySearch: efid=0x" +
                Integer.toHexString(efid).toUpperCase() + (VDBG ? " ("+ oldTag + "," +
                oldPhoneNumber + ")" + "==>" + " ("+ newTag + ","
                + newPhoneNumber + ")"+ " pin2=" + pin2 : ""));
                Integer.toHexString(efid).toUpperCase() + " ("+ Rlog.pii(LOG_TAG, oldTag) + "," +
                Rlog.pii(LOG_TAG, oldPhoneNumber) + ")" + "==>" + " ("+ Rlog.pii(LOG_TAG, newTag) +
                "," + Rlog.pii(LOG_TAG, newPhoneNumber) + ")"+ " pin2=" + Rlog.pii(LOG_TAG, pin2));

        efid = updateEfForIccType(efid);

@@ -226,8 +224,9 @@ public class IccPhoneBookInterfaceManager {
        }

        if (DBG) logd("updateAdnRecordsInEfByIndex: efid=0x" +
                Integer.toHexString(efid).toUpperCase() + " Index=" + index +
                (VDBG ? " ==> " + "(" + newTag + "," + newPhoneNumber + ")" + " pin2=" + pin2 : ""));
                Integer.toHexString(efid).toUpperCase() + " Index=" + index + " ==> " + "(" +
                Rlog.pii(LOG_TAG, newTag) + "," + Rlog.pii(LOG_TAG, newPhoneNumber) + ")" +
                " pin2=" + Rlog.pii(LOG_TAG, pin2));
        synchronized(mLock) {
            checkThread();
            mSuccess = false;
+10 −10
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.text.TextUtils;
import android.telephony.Rlog;
import android.util.Log;

import java.util.List;

@@ -43,7 +42,6 @@ import com.android.internal.telephony.uicc.IccConstants;
public class IccProvider extends ContentProvider {
    private static final String TAG = "IccProvider";
    private static final boolean DBG = true;
    private static final boolean VDBG = Rlog.isLoggable(TAG, Log.VERBOSE);


    private static final String[] ADDRESS_BOOK_COLUMN_NAMES = new String[] {
@@ -429,8 +427,8 @@ public class IccProvider extends ContentProvider {
    addIccRecordToEf(int efType, String name, String number, String[] emails,
            String pin2, int subId) {
        if (DBG) log("addIccRecordToEf: efType=0x" + Integer.toHexString(efType).toUpperCase() +
                (VDBG ? ", name=" + name + ", number=" + number + ", emails=" + emails : "") +
                ", subscription=" + subId);
                ", name=" + Rlog.pii(TAG, name) + ", number=" + Rlog.pii(TAG, number) +
                ", emails=" + Rlog.pii(TAG, emails) + ", subscription=" + subId);

        boolean success = false;

@@ -459,8 +457,9 @@ public class IccProvider extends ContentProvider {
    updateIccRecordInEf(int efType, String oldName, String oldNumber,
            String newName, String newNumber, String pin2, int subId) {
        if (DBG) log("updateIccRecordInEf: efType=0x" + Integer.toHexString(efType).toUpperCase() +
                (VDBG ? ", oldname=" + oldName + ", oldnumber=" + oldNumber + ", newname=" +
                        newName + ", newnumber=" + newName : "") + ", subscription=" + subId);
                ", oldname=" + Rlog.pii(TAG, oldName) + ", oldnumber=" + Rlog.pii(TAG, oldNumber) +
                ", newname=" + Rlog.pii(TAG, newName) + ", newnumber=" + Rlog.pii(TAG, newName) +
                ", subscription=" + subId);

        boolean success = false;

@@ -484,8 +483,9 @@ public class IccProvider extends ContentProvider {
    private boolean deleteIccRecordFromEf(int efType, String name, String number, String[] emails,
            String pin2, int subId) {
        if (DBG) log("deleteIccRecordFromEf: efType=0x" +
                Integer.toHexString(efType).toUpperCase() + (VDBG ? ", name=" + name + ", number=" +
                number + ", emails=" + emails + ", pin2=" + pin2 : "") + ", subscription=" + subId);
                Integer.toHexString(efType).toUpperCase() + ", name=" + Rlog.pii(TAG, name) +
                ", number=" + Rlog.pii(TAG, number) + ", emails=" + Rlog.pii(TAG, emails) +
                ", pin2=" + Rlog.pii(TAG, pin2) + ", subscription=" + subId);

        boolean success = false;

@@ -517,7 +517,7 @@ public class IccProvider extends ContentProvider {
            String alphaTag = record.getAlphaTag();
            String number = record.getNumber();

            if (DBG) log("loadRecord: " + alphaTag + (VDBG ? ", " + number : ""));
            if (DBG) log("loadRecord: " + alphaTag + ", " + Rlog.pii(TAG, number));
            contact[0] = alphaTag;
            contact[1] = number;

@@ -525,7 +525,7 @@ public class IccProvider extends ContentProvider {
            if (emails != null) {
                StringBuilder emailString = new StringBuilder();
                for (String email: emails) {
                    if (VDBG) log("Adding email:" + email);
                    log("Adding email:" + Rlog.pii(TAG, email));
                    emailString.append(email);
                    emailString.append(",");
                }
+1 −3
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.telephony.cdma.CdmaSmsCbProgramData;
import android.telephony.cdma.CdmaSmsCbProgramResults;
import android.text.format.Time;
import android.telephony.Rlog;
import android.util.Log;

import com.android.internal.telephony.GsmAlphabet;
import com.android.internal.telephony.GsmAlphabet.TextEncodingDetails;
@@ -436,8 +435,7 @@ public final class BearerData {
        builder.append(", readAckReq=" + readAckReq);
        builder.append(", reportReq=" + reportReq);
        builder.append(", numberOfMessages=" + numberOfMessages);
        builder.append(", callbackNumber=" +
                (Rlog.isLoggable(LOG_TAG, Log.DEBUG) ? callbackNumber : "XXX"));
        builder.append(", callbackNumber=" + Rlog.pii(LOG_TAG, callbackNumber));
        builder.append(", depositIndex=" + depositIndex);
        builder.append(", hasUserDataHeader=" + hasUserDataHeader);
        builder.append(", userData=" + userData);
+2 −3
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import android.os.PersistableBundle;
import android.os.PowerManager;
import android.os.Registrant;
import android.os.SystemClock;
import android.telecom.Log;
import android.telecom.VideoProfile;
import android.telephony.CarrierConfigManager;
import android.telephony.DisconnectCause;
@@ -753,7 +752,7 @@ public class ImsPhoneConnection extends Connection implements
            int namep = ImsCallProfile.OIRToPresentation(
                    callProfile.getCallExtraInt(ImsCallProfile.EXTRA_CNAP));
            if (Phone.DEBUG_PHONE) {
                Rlog.d(LOG_TAG, "address = " +  address + " name = " + name +
                Rlog.d(LOG_TAG, "address = " + Rlog.pii(LOG_TAG, address) + " name = " + name +
                        " nump = " + nump + " namep = " + namep);
            }
            if(equalsHandlesNulls(mAddress, address)) {
@@ -1022,7 +1021,7 @@ public class ImsPhoneConnection extends Connection implements
        sb.append(" telecomCallID: ");
        sb.append(getTelecomCallId());
        sb.append(" address: ");
        sb.append(Log.pii(getAddress()));
        sb.append(Rlog.pii(LOG_TAG, getAddress()));
        sb.append(" ImsCall: ");
        if (mImsCall == null) {
            sb.append("null");
+3 −5
Original line number Diff line number Diff line
@@ -541,7 +541,7 @@ public class SIMRecords extends IccRecords {

        try {
            if (validEfCfis(mEfCfis)) {
                // lsb is of byte 1 is voice status
                // lsb is of byte f1 is voice status
                if (enable) {
                    mEfCfis[1] |= 1;
                } else {
@@ -554,9 +554,7 @@ public class SIMRecords extends IccRecords {
                // Update dialNumber if not empty and CFU is enabled.
                // Spec reference for EF_CFIS contents, TS 51.011 section 10.3.46.
                if (enable && !TextUtils.isEmpty(dialNumber)) {
                    if (VDBG) {
                        logv("EF_CFIS: updating cf number, " + dialNumber);
                    }
                    logv("EF_CFIS: updating cf number, " + Rlog.pii(LOG_TAG, dialNumber));
                    byte[] bcdNumber = PhoneNumberUtils.numberToCalledPartyBCD(dialNumber);

                    System.arraycopy(bcdNumber, 0, mEfCfis, CFIS_TON_NPI_OFFSET, bcdNumber.length);
@@ -674,7 +672,7 @@ public class SIMRecords extends IccRecords {
                }

                log("IMSI: mMncLength=" + mMncLength);
                log("IMSI: " + mImsi.substring(0, 6) + "xxxxxxx");
                log("IMSI: " + mImsi.substring(0, 6) + Rlog.pii(LOG_TAG, mImsi.substring(6)));

                if (((mMncLength == UNKNOWN) || (mMncLength == 2)) &&
                        ((mImsi != null) && (mImsi.length() >= 6))) {