Remove "Backup Calling" button from Settings UI
Remove "Backup Calling" button from Settings UI, keep it always enabled.
Bug: 253698238
Test: build pass
Change-Id: Iff2665829e559ab7dce20e58a50ca75b8dcd6f83
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2dc4e65..91587a9 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -10510,12 +10510,15 @@
<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] -->
+ <!-- Deprecated ToDo: b/260059444 remove it next version-->
<string name="backup_calling_settings_title">Backup calling</string>
<!-- 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>
<!-- 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>
<!-- Title for enable MMS notification when trying to receive MMS. [CHAR LIMIT=40] -->
diff --git a/res/xml/mobile_network_settings.xml b/res/xml/mobile_network_settings.xml
index 96eacbc..22434b1 100644
--- a/res/xml/mobile_network_settings.xml
+++ b/res/xml/mobile_network_settings.xml
@@ -183,14 +183,6 @@
android:persistent="true"
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>
<com.android.settings.network.telephony.cdma.CdmaListPreference
diff --git a/res/xml/network_provider_calls_sms.xml b/res/xml/network_provider_calls_sms.xml
index 2281f48..8d15578 100644
--- a/res/xml/network_provider_calls_sms.xml
+++ b/res/xml/network_provider_calls_sms.xml
@@ -43,12 +43,4 @@
settings:controller="com.android.settings.network.telephony.NetworkProviderWifiCallingPreferenceController"
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>
diff --git a/src/com/android/settings/network/NetworkProviderCallsSmsFragment.java b/src/com/android/settings/network/NetworkProviderCallsSmsFragment.java
index ab247f1..772db45 100644
--- a/src/com/android/settings/network/NetworkProviderCallsSmsFragment.java
+++ b/src/com/android/settings/network/NetworkProviderCallsSmsFragment.java
@@ -26,7 +26,6 @@
import com.android.settings.Utils;
import com.android.settings.dashboard.DashboardFragment;
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.SmsDefaultSubscriptionController;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -42,9 +41,6 @@
static final String LOG_TAG = "NetworkProviderCallsSmsFragment";
@VisibleForTesting
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
static final String KEY_PREFERENCE_CALLS= "provider_model_calls_preference";
@@ -67,12 +63,6 @@
mNetworkProviderWifiCallingPreferenceController.init(getSettingsLifecycle());
controllers.add(mNetworkProviderWifiCallingPreferenceController);
- NetworkProviderBackupCallingPreferenceController backupCallingPrefCtrl =
- new NetworkProviderBackupCallingPreferenceController(context,
- KEY_PREFERENCE_CATEGORY_BACKUP_CALLING);
- backupCallingPrefCtrl.init(getSettingsLifecycle());
- controllers.add(backupCallingPrefCtrl);
-
return controllers;
}
diff --git a/src/com/android/settings/network/telephony/BackupCallingPreferenceController.java b/src/com/android/settings/network/telephony/BackupCallingPreferenceController.java
index 4f64399..3db6dfe 100644
--- a/src/com/android/settings/network/telephony/BackupCallingPreferenceController.java
+++ b/src/com/android/settings/network/telephony/BackupCallingPreferenceController.java
@@ -38,6 +38,7 @@
/**
* Preference controller for "Backup Calling"
+ * Deprecated ToDo: b/260059444 remove it next version
**/
public class BackupCallingPreferenceController extends TelephonyTogglePreferenceController {
diff --git a/src/com/android/settings/network/telephony/MobileNetworkSettings.java b/src/com/android/settings/network/telephony/MobileNetworkSettings.java
index ae83c43..df7fd83 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkSettings.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkSettings.java
@@ -269,11 +269,6 @@
final VideoCallingPreferenceController videoCallingPreferenceController =
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)
.addListener(videoCallingPreferenceController);
use(Enhanced4gCallingPreferenceController.class).init(mSubId)
diff --git a/src/com/android/settings/network/telephony/NetworkProviderBackupCallingGroup.java b/src/com/android/settings/network/telephony/NetworkProviderBackupCallingGroup.java
index 58dd18f..3659f65 100644
--- a/src/com/android/settings/network/telephony/NetworkProviderBackupCallingGroup.java
+++ b/src/com/android/settings/network/telephony/NetworkProviderBackupCallingGroup.java
@@ -49,6 +49,7 @@
/**
* Preference controller for "Backup Calling"
+ * Deprecated ToDo: b/260059444 remove it next version
**/
public class NetworkProviderBackupCallingGroup extends
TelephonyTogglePreferenceController implements LifecycleObserver,
diff --git a/src/com/android/settings/network/telephony/NetworkProviderBackupCallingPreferenceController.java b/src/com/android/settings/network/telephony/NetworkProviderBackupCallingPreferenceController.java
index 5c336ef..c10bfb8 100644
--- a/src/com/android/settings/network/telephony/NetworkProviderBackupCallingPreferenceController.java
+++ b/src/com/android/settings/network/telephony/NetworkProviderBackupCallingPreferenceController.java
@@ -32,6 +32,7 @@
/**
* Preference controller for "Backup Calling" summary list
+ * Deprecated ToDo: b/260059444 remove it next version
*/
public class NetworkProviderBackupCallingPreferenceController extends
BasePreferenceController implements LifecycleObserver {
diff --git a/tests/unit/src/com/android/settings/network/telephony/BackupCallingPreferenceControllerTest.java b/tests/unit/src/com/android/settings/network/telephony/BackupCallingPreferenceControllerTest.java
index 4e110f0..34d7c92 100644
--- a/tests/unit/src/com/android/settings/network/telephony/BackupCallingPreferenceControllerTest.java
+++ b/tests/unit/src/com/android/settings/network/telephony/BackupCallingPreferenceControllerTest.java
@@ -28,9 +28,13 @@
import com.android.settings.core.BasePreferenceController;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
+/**
+ * Deprecated ToDo: b/260059444 remove it next version
+ */
@RunWith(AndroidJUnit4.class)
public class BackupCallingPreferenceControllerTest {
private static final int SUB_ID = 2;
@@ -47,6 +51,7 @@
}
@Test
+ @Ignore
public void controller_isUnavailable() {
assertThat(mController.getAvailabilityStatus())
.isEqualTo(BasePreferenceController.CONDITIONALLY_UNAVAILABLE);
diff --git a/tests/unit/src/com/android/settings/network/telephony/NetworkProviderBackupCallingGroupTest.java b/tests/unit/src/com/android/settings/network/telephony/NetworkProviderBackupCallingGroupTest.java
index a5717ef..09f0200 100644
--- a/tests/unit/src/com/android/settings/network/telephony/NetworkProviderBackupCallingGroupTest.java
+++ b/tests/unit/src/com/android/settings/network/telephony/NetworkProviderBackupCallingGroupTest.java
@@ -40,6 +40,7 @@
import com.android.settingslib.core.lifecycle.Lifecycle;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -47,6 +48,9 @@
import java.util.List;
+/**
+ * Deprecated ToDo: b/260059444 remove it next version
+ */
@RunWith(AndroidJUnit4.class)
public class NetworkProviderBackupCallingGroupTest {
@@ -133,12 +137,14 @@
}
@Test
+ @Ignore
public void shouldShowBackupCallingForSub_invalidSubId_returnFalse() {
assertThat(mNetworkProviderBackupCallingGroup.hasBackupCallingFeature(
SubscriptionManager.INVALID_SUBSCRIPTION_ID)).isEqualTo(false);
}
@Test
+ @Ignore
public void shouldShowBackupCallingForSub_carrierConfigIsUnavailable_returnFalse() {
mCarrierConfig.putBoolean(CarrierConfigManager.KEY_CARRIER_CROSS_SIM_IMS_AVAILABLE_BOOL,
false);
@@ -148,6 +154,7 @@
}
@Test
+ @Ignore
public void
shouldShowBackupCallingForSub_crossSimDisabled_returnFalse() {
doReturn(false).when(mNetworkProviderBackupCallingGroup).isCrossSimEnabledByPlatform(
@@ -158,6 +165,7 @@
}
@Test
+ @Ignore
public void shouldBackupCallingForSub_crossSimEnabled_returnTrue() {
doReturn(true).when(mNetworkProviderBackupCallingGroup).isCrossSimEnabledByPlatform(
mContext, SUB_ID_1);