Merge "Fix the system crash issue when secondary user clicks any 802.1x AP on Wifi Picker." into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-14 06:53:12 +00:00
committed by Android (Google) Code Review
2 changed files with 34 additions and 2 deletions

View File

@@ -1216,6 +1216,11 @@ public class WifiConfigController implements TextWatcher,
}
}
@VisibleForTesting
KeyStore getKeyStore() {
return KeyStore.getInstance();
}
private void loadCertificates(
Spinner spinner,
String prefix,
@@ -1232,8 +1237,12 @@ public class WifiConfigController implements TextWatcher,
if (showUsePreinstalledCertOption) {
certs.add(mUseSystemCertsString);
}
certs.addAll(
Arrays.asList(KeyStore.getInstance().list(prefix, android.os.Process.WIFI_UID)));
try {
certs.addAll(
Arrays.asList(getKeyStore().list(prefix, android.os.Process.WIFI_UID)));
} catch (Exception e) {
Log.e(TAG, "can't get the certificate list from KeyStore");
}
certs.add(noCertificateString);
final ArrayAdapter<String> adapter = new ArrayAdapter<String>(