[Provider model] Show a string on internet picker when mobile data off
- https://screenshot.googleplex.com/6JE9ma6UZmGCNFQ Bug: 178680922 Test: Manual test passed Test: atest passed Change-Id: Id276e3f97b4380f648eb9e35ca7780a0ba32bdb2
This commit is contained in:
@@ -35,6 +35,7 @@ import android.telephony.SubscriptionInfo;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyDisplayInfo;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.Html;
|
||||
import android.util.ArraySet;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
@@ -255,14 +256,17 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
|
||||
mUpdateListener.onChildrenUpdated();
|
||||
}
|
||||
|
||||
private String getMobilePreferenceSummary(int subId) {
|
||||
private CharSequence getMobilePreferenceSummary(int subId) {
|
||||
String result = mSubsPrefCtrlInjector.getNetworkType(
|
||||
mContext, mConfig, mTelephonyDisplayInfo, subId);
|
||||
if (!mTelephonyManager.isDataEnabled()) {
|
||||
return mContext.getString(R.string.mobile_data_off_summary);
|
||||
}
|
||||
if (!result.isEmpty() && mSubsPrefCtrlInjector.isActiveCellularNetwork(mContext)) {
|
||||
result = mContext.getString(R.string.preference_summary_default_combination,
|
||||
mContext.getString(R.string.mobile_data_connection_active), result);
|
||||
}
|
||||
return result;
|
||||
return Html.fromHtml(result, Html.FROM_HTML_MODE_LEGACY);
|
||||
}
|
||||
|
||||
private Drawable getIcon(int subId) {
|
||||
|
Reference in New Issue
Block a user