Merge "Can't show 5GE at summary" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
851a2f8557
@@ -29,6 +29,7 @@ import android.telephony.SignalStrength;
|
||||
import android.telephony.SubscriptionInfo;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.Html;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -141,7 +142,7 @@ public class ProviderModelSliceHelper {
|
||||
.setTitleItem(levelIcon, ListBuilder.ICON_IMAGE)
|
||||
.addEndItem(toggleAction)
|
||||
.setPrimaryAction(primaryAction)
|
||||
.setSubtitle(summary);
|
||||
.setSubtitle(Html.fromHtml(summary, Html.FROM_HTML_MODE_LEGACY));
|
||||
return rowBuilder;
|
||||
}
|
||||
|
||||
|
@@ -40,6 +40,7 @@ import android.telephony.ServiceState;
|
||||
import android.telephony.SubscriptionInfo;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.Html;
|
||||
|
||||
import androidx.slice.Slice;
|
||||
import androidx.slice.builders.GridRowBuilder;
|
||||
@@ -169,7 +170,7 @@ public class ProviderModelSliceHelperTest {
|
||||
@Test
|
||||
public void createCarrierRow_hasDdsAndActiveNetworkIsNotCellular_verifyTitleAndSummary() {
|
||||
String expectDisplayName = "Name1";
|
||||
String expectedSubtitle = "5G";
|
||||
CharSequence expectedSubtitle = Html.fromHtml("5G", Html.FROM_HTML_MODE_LEGACY);
|
||||
String networkType = "5G";
|
||||
|
||||
final int defaultDataSubId = SubscriptionManager.getDefaultDataSubscriptionId();
|
||||
@@ -199,8 +200,9 @@ public class ProviderModelSliceHelperTest {
|
||||
String networkType = "5G";
|
||||
String connectedText = ResourcesUtils.getResourcesString(mContext,
|
||||
"mobile_data_connection_active");
|
||||
String expectedSubtitle = ResourcesUtils.getResourcesString(mContext,
|
||||
"preference_summary_default_combination", connectedText, networkType);
|
||||
CharSequence expectedSubtitle = Html.fromHtml(ResourcesUtils.getResourcesString(mContext,
|
||||
"preference_summary_default_combination", connectedText, networkType),
|
||||
Html.FROM_HTML_MODE_LEGACY);
|
||||
|
||||
final int defaultDataSubId = SubscriptionManager.getDefaultDataSubscriptionId();
|
||||
when(mDefaultDataSubscriptionInfo.getSubscriptionId()).thenReturn(defaultDataSubId);
|
||||
|
Reference in New Issue
Block a user