Merge "[Settings] Prevent NPE from getting MobileIconGroup instance." into sc-dev am: c09f986580
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15173454 Change-Id: I8567ac8442256cd4beb0891fcfacb052a26e03b2
This commit is contained in:
@@ -603,7 +603,11 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
|
|||||||
public String getNetworkType(Context context, Config config,
|
public String getNetworkType(Context context, Config config,
|
||||||
TelephonyDisplayInfo telephonyDisplayInfo, int subId) {
|
TelephonyDisplayInfo telephonyDisplayInfo, int subId) {
|
||||||
String iconKey = getIconKey(telephonyDisplayInfo);
|
String iconKey = getIconKey(telephonyDisplayInfo);
|
||||||
int resId = mapIconSets(config).get(iconKey).dataContentDescription;
|
MobileIconGroup iconGroup = mapIconSets(config).get(iconKey);
|
||||||
|
int resId = 0;
|
||||||
|
if (iconGroup != null) {
|
||||||
|
resId = iconGroup.dataContentDescription;
|
||||||
|
}
|
||||||
return resId != 0
|
return resId != 0
|
||||||
? SubscriptionManager.getResourcesForSubId(context, subId).getString(resId)
|
? SubscriptionManager.getResourcesForSubId(context, subId).getString(resId)
|
||||||
: "";
|
: "";
|
||||||
|
Reference in New Issue
Block a user