[Provider Model] 1. Use the original string for Calls & SMS 2. Set preferred status in Call & SMS

1.
UX modify the string in document

Dual SIMs:
    Calls & SMS
    Google Fi (preferred), AT&T

    Calls & SMS
    Google Fi (preferred for calls), AT&T (preferred for SMS)

    Calls & SMS
    Google Fi (Temporarily unavailable), AT&T

Single SIM:
    Calls & SMS
    Temporarily unavailable

2.
UX: https://screenshot.googleplex.com/B9BETTwRoa4mfds.png
Implementation: https://screenshot.googleplex.com/4vxMLBynwdTvhEs.png

Bug: 178916743
Test: make
Change-Id: I444eb0e3361707764dae18b9fa942c7f7a80a2c6
This commit is contained in:
Zoey Chen
2021-02-04 14:16:48 +08:00
parent 2184c4eecc
commit 35dcb7c7f1
6 changed files with 136 additions and 16 deletions

View File

@@ -93,7 +93,7 @@ public class NetworkProviderCallsSmsControllerTest {
private int mDefaultVoiceSubscriptionId;
private int mDefaultSmsSubscriptionId;
private boolean mIsInService;
@Override
protected int getDefaultVoiceSubscriptionId() {
return mDefaultVoiceSubscriptionId;
@@ -104,6 +104,11 @@ public class NetworkProviderCallsSmsControllerTest {
return mDefaultSmsSubscriptionId;
}
@Override
protected boolean isInService(int subId) {
return mIsInService;
}
public void setDefaultVoiceSubscriptionId(int subscriptionId) {
mDefaultVoiceSubscriptionId = subscriptionId;
}
@@ -111,6 +116,10 @@ public class NetworkProviderCallsSmsControllerTest {
public void setDefaultSmsSubscriptionId(int subscriptionId) {
mDefaultSmsSubscriptionId = subscriptionId;
}
public void setInService(boolean inService) {
mIsInService = inService;
}
}
@Before
@@ -128,7 +137,7 @@ public class NetworkProviderCallsSmsControllerTest {
mPreference = new RestrictedPreference(mContext);
mPreference.setKey(KEY_PREFERENCE_CALLS_SMS);
mController = new MockNetworkProviderCallsSmsController(mContext, mLifecycle);
mController.setInService(true);
mLifecycleRegistry = new LifecycleRegistry(mLifecycleOwner);
when(mLifecycleOwner.getLifecycle()).thenReturn(mLifecycleRegistry);
}
@@ -176,7 +185,7 @@ public class NetworkProviderCallsSmsControllerTest {
final StringBuilder summary = new StringBuilder();
summary.append(DISPLAY_NAME_1)
.append(" (")
.append(setSummaryResId("calls_sms_unavailable"))
.append(setSummaryResId("calls_sms_temp_unavailable"))
.append(")");
assertTrue(TextUtils.equals(mController.getSummary(), summary));