Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 851a2f85 authored by SongFerng Wang's avatar SongFerng Wang Committed by Android (Google) Code Review
Browse files

Merge "Can't show 5GE at summary" into sc-dev

parents 1ebb7fa0 35b47259
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
    }

+5 −3
Original line number Diff line number Diff line
@@ -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);