Merge "Revert "Remove "Backup Calling" button from Settings UI""

This commit is contained in:
SongFerng Wang
2022-12-14 05:56:43 +00:00
committed by Android (Google) Code Review
10 changed files with 31 additions and 19 deletions

View File

@@ -10616,15 +10616,12 @@
<string name="wifi_calling_summary">Use Wi\u2011Fi for calls to improve quality</string> <string name="wifi_calling_summary">Use Wi\u2011Fi for calls to improve quality</string>
<!-- Mobile network settings screen, title of Backup calling setting. [CHAR LIMIT=NONE] --> <!-- Mobile network settings screen, title of Backup calling setting. [CHAR LIMIT=NONE] -->
<!-- Deprecated ToDo: b/260059444 remove it next version-->
<string name="backup_calling_settings_title">Backup calling</string> <string name="backup_calling_settings_title">Backup calling</string>
<!-- Backup calling summary. [CHAR LIMIT=100] --> <!-- Backup calling summary. [CHAR LIMIT=100] -->
<!-- Deprecated ToDo: b/260059444 remove it next version-->
<string name="backup_calling_setting_summary">If <xliff:g id="backup_calling_operator_text" example="Google Fi">%1$s</xliff:g> is unavailable or roaming, use your mobile data SIM for <xliff:g id="backup_calling_carrier_text" example="Google Fi">%1$s</xliff:g> calls.</string> <string name="backup_calling_setting_summary">If <xliff:g id="backup_calling_operator_text" example="Google Fi">%1$s</xliff:g> is unavailable or roaming, use your mobile data SIM for <xliff:g id="backup_calling_carrier_text" example="Google Fi">%1$s</xliff:g> calls.</string>
<!-- List of synonyms for the cross SIM calling titles, used to match in settings search [CHAR LIMIT=NONE] --> <!-- List of synonyms for the cross SIM calling titles, used to match in settings search [CHAR LIMIT=NONE] -->
<!-- Deprecated ToDo: b/260059444 remove it next version-->
<string name="keywords_backup_calling">backup calling</string> <string name="keywords_backup_calling">backup calling</string>
<!-- Title for enable MMS notification when trying to receive MMS. [CHAR LIMIT=40] --> <!-- Title for enable MMS notification when trying to receive MMS. [CHAR LIMIT=40] -->

View File

@@ -183,6 +183,14 @@
android:persistent="true" android:persistent="true"
settings:controller="com.android.settings.network.telephony.VideoCallingPreferenceController"/> settings:controller="com.android.settings.network.telephony.VideoCallingPreferenceController"/>
<SwitchPreference
android:key="backup_calling_key"
android:title="@string/backup_calling_settings_title"
android:persistent="false"
android:summary="@string/backup_calling_setting_summary"
settings:keywords="@string/keywords_backup_calling"
settings:controller="com.android.settings.network.telephony.BackupCallingPreferenceController"/>
</PreferenceCategory> </PreferenceCategory>
<com.android.settings.network.telephony.cdma.CdmaListPreference <com.android.settings.network.telephony.cdma.CdmaListPreference

View File

@@ -43,4 +43,12 @@
settings:controller="com.android.settings.network.telephony.NetworkProviderWifiCallingPreferenceController" settings:controller="com.android.settings.network.telephony.NetworkProviderWifiCallingPreferenceController"
settings:allowDividerAbove="true" settings:allowDividerAbove="true"
/> />
<PreferenceCategory
android:key="provider_model_backup_calling_category"
android:title="@string/backup_calling_settings_title"
android:order="25"
settings:controller="com.android.settings.network.telephony.NetworkProviderBackupCallingPreferenceController"
settings:allowDividerAbove="true"
/>
</PreferenceScreen> </PreferenceScreen>

View File

@@ -26,6 +26,7 @@ import com.android.settings.R;
import com.android.settings.Utils; import com.android.settings.Utils;
import com.android.settings.dashboard.DashboardFragment; import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.network.telephony.CallsDefaultSubscriptionController; import com.android.settings.network.telephony.CallsDefaultSubscriptionController;
import com.android.settings.network.telephony.NetworkProviderBackupCallingPreferenceController;
import com.android.settings.network.telephony.NetworkProviderWifiCallingPreferenceController; import com.android.settings.network.telephony.NetworkProviderWifiCallingPreferenceController;
import com.android.settings.network.telephony.SmsDefaultSubscriptionController; import com.android.settings.network.telephony.SmsDefaultSubscriptionController;
import com.android.settings.search.BaseSearchIndexProvider; import com.android.settings.search.BaseSearchIndexProvider;
@@ -41,6 +42,9 @@ public class NetworkProviderCallsSmsFragment extends DashboardFragment {
static final String LOG_TAG = "NetworkProviderCallsSmsFragment"; static final String LOG_TAG = "NetworkProviderCallsSmsFragment";
@VisibleForTesting @VisibleForTesting
static final String KEY_PREFERENCE_CATEGORY_CALLING = "provider_model_calling_category"; static final String KEY_PREFERENCE_CATEGORY_CALLING = "provider_model_calling_category";
@VisibleForTesting
static final String KEY_PREFERENCE_CATEGORY_BACKUP_CALLING =
"provider_model_backup_calling_category";
@VisibleForTesting @VisibleForTesting
static final String KEY_PREFERENCE_CALLS= "provider_model_calls_preference"; static final String KEY_PREFERENCE_CALLS= "provider_model_calls_preference";
@@ -63,6 +67,12 @@ public class NetworkProviderCallsSmsFragment extends DashboardFragment {
mNetworkProviderWifiCallingPreferenceController.init(getSettingsLifecycle()); mNetworkProviderWifiCallingPreferenceController.init(getSettingsLifecycle());
controllers.add(mNetworkProviderWifiCallingPreferenceController); controllers.add(mNetworkProviderWifiCallingPreferenceController);
NetworkProviderBackupCallingPreferenceController backupCallingPrefCtrl =
new NetworkProviderBackupCallingPreferenceController(context,
KEY_PREFERENCE_CATEGORY_BACKUP_CALLING);
backupCallingPrefCtrl.init(getSettingsLifecycle());
controllers.add(backupCallingPrefCtrl);
return controllers; return controllers;
} }

View File

@@ -38,7 +38,6 @@ import java.util.Objects;
/** /**
* Preference controller for "Backup Calling" * Preference controller for "Backup Calling"
* Deprecated ToDo: b/260059444 remove it next version
**/ **/
public class BackupCallingPreferenceController extends TelephonyTogglePreferenceController { public class BackupCallingPreferenceController extends TelephonyTogglePreferenceController {

View File

@@ -281,6 +281,11 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
final VideoCallingPreferenceController videoCallingPreferenceController = final VideoCallingPreferenceController videoCallingPreferenceController =
use(VideoCallingPreferenceController.class).init(mSubId); use(VideoCallingPreferenceController.class).init(mSubId);
final BackupCallingPreferenceController crossSimCallingPreferenceController =
use(BackupCallingPreferenceController.class).init(mSubId);
use(CallingPreferenceCategoryController.class).setChildren(
Arrays.asList(wifiCallingPreferenceController, videoCallingPreferenceController,
crossSimCallingPreferenceController));
use(Enhanced4gLtePreferenceController.class).init(mSubId) use(Enhanced4gLtePreferenceController.class).init(mSubId)
.addListener(videoCallingPreferenceController); .addListener(videoCallingPreferenceController);
use(Enhanced4gCallingPreferenceController.class).init(mSubId) use(Enhanced4gCallingPreferenceController.class).init(mSubId)

View File

@@ -49,7 +49,6 @@ import java.util.Map;
/** /**
* Preference controller for "Backup Calling" * Preference controller for "Backup Calling"
* Deprecated ToDo: b/260059444 remove it next version
**/ **/
public class NetworkProviderBackupCallingGroup extends public class NetworkProviderBackupCallingGroup extends
TelephonyTogglePreferenceController implements LifecycleObserver, TelephonyTogglePreferenceController implements LifecycleObserver,

View File

@@ -32,7 +32,6 @@ import java.util.List;
/** /**
* Preference controller for "Backup Calling" summary list * Preference controller for "Backup Calling" summary list
* Deprecated ToDo: b/260059444 remove it next version
*/ */
public class NetworkProviderBackupCallingPreferenceController extends public class NetworkProviderBackupCallingPreferenceController extends
BasePreferenceController implements LifecycleObserver { BasePreferenceController implements LifecycleObserver {

View File

@@ -28,13 +28,9 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.android.settings.core.BasePreferenceController; import com.android.settings.core.BasePreferenceController;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
/**
* Deprecated ToDo: b/260059444 remove it next version
*/
@RunWith(AndroidJUnit4.class) @RunWith(AndroidJUnit4.class)
public class BackupCallingPreferenceControllerTest { public class BackupCallingPreferenceControllerTest {
private static final int SUB_ID = 2; private static final int SUB_ID = 2;
@@ -51,7 +47,6 @@ public class BackupCallingPreferenceControllerTest {
} }
@Test @Test
@Ignore
public void controller_isUnavailable() { public void controller_isUnavailable() {
assertThat(mController.getAvailabilityStatus()) assertThat(mController.getAvailabilityStatus())
.isEqualTo(BasePreferenceController.CONDITIONALLY_UNAVAILABLE); .isEqualTo(BasePreferenceController.CONDITIONALLY_UNAVAILABLE);

View File

@@ -40,7 +40,6 @@ import com.android.settings.network.CarrierConfigCache;
import com.android.settingslib.core.lifecycle.Lifecycle; import com.android.settingslib.core.lifecycle.Lifecycle;
import org.junit.Before; import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.mockito.Mock; import org.mockito.Mock;
@@ -48,9 +47,6 @@ import org.mockito.MockitoAnnotations;
import java.util.List; import java.util.List;
/**
* Deprecated ToDo: b/260059444 remove it next version
*/
@RunWith(AndroidJUnit4.class) @RunWith(AndroidJUnit4.class)
public class NetworkProviderBackupCallingGroupTest { public class NetworkProviderBackupCallingGroupTest {
@@ -137,14 +133,12 @@ public class NetworkProviderBackupCallingGroupTest {
} }
@Test @Test
@Ignore
public void shouldShowBackupCallingForSub_invalidSubId_returnFalse() { public void shouldShowBackupCallingForSub_invalidSubId_returnFalse() {
assertThat(mNetworkProviderBackupCallingGroup.hasBackupCallingFeature( assertThat(mNetworkProviderBackupCallingGroup.hasBackupCallingFeature(
SubscriptionManager.INVALID_SUBSCRIPTION_ID)).isEqualTo(false); SubscriptionManager.INVALID_SUBSCRIPTION_ID)).isEqualTo(false);
} }
@Test @Test
@Ignore
public void shouldShowBackupCallingForSub_carrierConfigIsUnavailable_returnFalse() { public void shouldShowBackupCallingForSub_carrierConfigIsUnavailable_returnFalse() {
mCarrierConfig.putBoolean(CarrierConfigManager.KEY_CARRIER_CROSS_SIM_IMS_AVAILABLE_BOOL, mCarrierConfig.putBoolean(CarrierConfigManager.KEY_CARRIER_CROSS_SIM_IMS_AVAILABLE_BOOL,
false); false);
@@ -154,7 +148,6 @@ public class NetworkProviderBackupCallingGroupTest {
} }
@Test @Test
@Ignore
public void public void
shouldShowBackupCallingForSub_crossSimDisabled_returnFalse() { shouldShowBackupCallingForSub_crossSimDisabled_returnFalse() {
doReturn(false).when(mNetworkProviderBackupCallingGroup).isCrossSimEnabledByPlatform( doReturn(false).when(mNetworkProviderBackupCallingGroup).isCrossSimEnabledByPlatform(
@@ -165,7 +158,6 @@ public class NetworkProviderBackupCallingGroupTest {
} }
@Test @Test
@Ignore
public void shouldBackupCallingForSub_crossSimEnabled_returnTrue() { public void shouldBackupCallingForSub_crossSimEnabled_returnTrue() {
doReturn(true).when(mNetworkProviderBackupCallingGroup).isCrossSimEnabledByPlatform( doReturn(true).when(mNetworkProviderBackupCallingGroup).isCrossSimEnabledByPlatform(
mContext, SUB_ID_1); mContext, SUB_ID_1);