From d793e9512d0088adb6211ab1e63afb30e7b37fa5 Mon Sep 17 00:00:00 2001 From: tom hsu Date: Thu, 26 May 2022 17:41:13 +0800 Subject: [PATCH] Fix wrong summary string show on the network page. Bug: 206742805 Test: local test, see b/206742805#4 Change-Id: I4fa9468e4f3b7d3671e383d3203b67636daa416c --- .../network/SubscriptionsPreferenceController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/network/SubscriptionsPreferenceController.java b/src/com/android/settings/network/SubscriptionsPreferenceController.java index fb384d4713e..825cb09ba53 100644 --- a/src/com/android/settings/network/SubscriptionsPreferenceController.java +++ b/src/com/android/settings/network/SubscriptionsPreferenceController.java @@ -274,8 +274,12 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl String result = mSubsPrefCtrlInjector.getNetworkType( mContext, mConfig, mTelephonyDisplayInfo, subId, isCarrierNetworkActive); if (mSubsPrefCtrlInjector.isActiveCellularNetwork(mContext) || isCarrierNetworkActive) { - result = mContext.getString(R.string.preference_summary_default_combination, - mContext.getString(R.string.mobile_data_connection_active), result); + if (result.isEmpty()) { + result = mContext.getString(R.string.mobile_data_connection_active); + } else { + result = mContext.getString(R.string.preference_summary_default_combination, + mContext.getString(R.string.mobile_data_connection_active), result); + } } else if (!isDataInService) { result = mContext.getString(R.string.mobile_data_no_connection); }