add eap_method and phase2_method string in enterpriseConfig for dump

Currently we don't print any information for eap_method and
phase2_method.
Without this information, it is difficult know that the configuration is
created correctly.

Bug: 123089627
Test: ./frameworks/base/wifi/tests/runtests.sh
Change-Id: I933790a87bd38d4af7438c61f4e12f2e0488d3a1
Signed-off-by: Ecco Park <eccopark@google.com>
This commit is contained in:
Ecco Park
2019-01-29 14:31:27 -08:00
parent 612ffdd8ea
commit d987b7278e

View File

@@ -23,17 +23,9 @@ import android.security.Credentials;
import android.text.TextUtils;
import android.util.Log;
import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -1126,6 +1118,12 @@ public class WifiEnterpriseConfig implements Parcelable {
String value = PASSWORD_KEY.equals(key) ? "<removed>" : mFields.get(key);
sb.append(key).append(" ").append(value).append("\n");
}
if (mEapMethod >= 0 && mEapMethod < Eap.strings.length) {
sb.append("eap_method: ").append(Eap.strings[mEapMethod]).append("\n");
}
if (mPhase2Method > 0 && mPhase2Method < Phase2.strings.length) {
sb.append("phase2_method: ").append(Phase2.strings[mPhase2Method]).append("\n");
}
return sb.toString();
}