Merge changes I6194592d,I5a02f847 am: 44146c8e3b

Change-Id: I2ebc5edd89fb32b2698c8cfd6acb20342c9cec17
This commit is contained in:
Treehugger Robot
2020-04-30 03:17:19 +00:00
committed by Automerger Merge Worker

View File

@@ -82,13 +82,18 @@ public class NrDisabledInDsdsFooterPreferenceController extends BasePreferenceCo
final TelephonyManager teleManager = ((TelephonyManager) final TelephonyManager teleManager = ((TelephonyManager)
mContext.getSystemService(Context.TELEPHONY_SERVICE)) mContext.getSystemService(Context.TELEPHONY_SERVICE))
.createForSubscriptionId(mSubId); .createForSubscriptionId(mSubId);
final SubscriptionManager subManager = ((SubscriptionManager)
mContext.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE));
final int[] activeSubIdList = subManager.getActiveSubscriptionIdList();
final int activeSubCount = activeSubIdList == null ? 0 : activeSubIdList.length;
// Show the footer only when DSDS is enabled, and mobile data is enabled on this SIM, and // Show the footer only when DSDS is enabled, and mobile data is enabled on this SIM, and
// 5G is supported on this device. // 5G is supported on this device.
if (!teleManager.isDataEnabled() || teleManager.getActiveModemCount() < 2 if (teleManager.isDataEnabled() && activeSubCount >= 2 && is5GSupportedByRadio(teleManager)
|| !is5GSupportedByRadio(teleManager)) { && !teleManager.canConnectTo5GInDsdsMode()) {
return AVAILABLE;
} else {
return CONDITIONALLY_UNAVAILABLE; return CONDITIONALLY_UNAVAILABLE;
} }
return AVAILABLE;
} }
private boolean is5GSupportedByRadio(TelephonyManager tm) { private boolean is5GSupportedByRadio(TelephonyManager tm) {