OSDN Git Service

Hide APN, USER and Password from log in SETUP_DATA_CALL
authorNaoyuki Konda <naoyuki.konda@sony.com>
Fri, 16 Feb 2018 05:13:12 +0000 (14:13 +0900)
committerNaoyuki Konda <naoyuki.konda@sony.com>
Tue, 20 Feb 2018 10:48:24 +0000 (19:48 +0900)
Some operators don't want to show apn, user, password.

Test: manual
Bug: 35411757
Change-Id: I357fd561d5b8aa9c6596786c9731e8f3cd9c532c

telephony/java/android/telephony/data/DataProfile.java

index 41c1430..e8597b2 100644 (file)
@@ -17,6 +17,7 @@
 package android.telephony.data;
 
 import android.annotation.SystemApi;
+import android.os.Build;
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.text.TextUtils;
@@ -230,8 +231,10 @@ public final class DataProfile implements Parcelable {
 
     @Override
     public String toString() {
-        return "DataProfile=" + mProfileId + "/" + mApn + "/" + mProtocol + "/" + mAuthType
-                + "/" + mUserName + "/" + mPassword + "/" + mType + "/" + mMaxConnsTime
+        return "DataProfile=" + mProfileId + "/" + mProtocol + "/" + mAuthType
+                + "/" + (Build.IS_USER ? "***/***/***" :
+                         (mApn + "/" + mUserName + "/" + mPassword))
+                + "/" + mType + "/" + mMaxConnsTime
                 + "/" + mMaxConns + "/" + mWaitTime + "/" + mEnabled + "/"
                 + mSupportedApnTypesBitmap + "/" + mRoamingProtocol + "/" + mBearerBitmap + "/"
                 + mMtu + "/" + mMvnoType + "/" + mMvnoMatchData + "/" + mModemCognitive;