diff options
author | David Su <dysu@google.com> | 2019-05-14 20:10:25 -0700 |
---|---|---|
committer | David Su <dysu@google.com> | 2019-05-16 16:59:07 +0000 |
commit | ba6afe1adbb6afed25bd78e88b541326d969dba2 (patch) | |
tree | c827008f41e897ffd34639bc8a55d916bb43608d /service | |
parent | a9bc047b9c7118321159a5cae2f246096be33395 (diff) |
Fix NPE from null cellular subscription displayName
Check for null before calling toString() on possibly null displayName.
Bug: 132391746
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: Iba33501c90ca552c08aaee52d36f1610bd6a6180
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/CarrierNetworkConfig.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/CarrierNetworkConfig.java b/service/java/com/android/server/wifi/CarrierNetworkConfig.java index 6e754231f..20aac5bc1 100644 --- a/service/java/com/android/server/wifi/CarrierNetworkConfig.java +++ b/service/java/com/android/server/wifi/CarrierNetworkConfig.java @@ -249,9 +249,11 @@ public class CarrierNetworkConfig { // Process the carrier config for each active subscription. for (SubscriptionInfo subInfo : subInfoList) { - processNetworkConfig( - carrierConfigManager.getConfigForSubId(subInfo.getSubscriptionId()), - subInfo.getDisplayName().toString()); + CharSequence displayNameCs = subInfo.getDisplayName(); + String displayNameStr = displayNameCs == null ? "" : displayNameCs.toString(); + PersistableBundle bundle = carrierConfigManager.getConfigForSubId( + subInfo.getSubscriptionId()); + processNetworkConfig(bundle, displayNameStr); } } |