WFC roaming mode setting can not be used with a fixed value

WFC roaming mode setting can not be used with a fixed value because it
is changed as WFC home mode changes if
KEY_EDITABLE_WFC_ROAMING_MODE_BOOL is false.

To solve this issue, separate the WFC mode setting of home and roaming.
These can switch behavior by new carrier config
KEY_USE_WFC_HOME_NETWORK_MODE_IN_ROAMING_NETWORK_BOOL.

Test: manual - Checked that WFC roaming mode is hidden if new config is
true.
Test: manual - Checked that WFC roaming mode is also changed when
change the WFC home mode if new config is true.
Test: auto - Passed WifiCallingSettingsForSubTest.
Bug: 79666081

Change-Id: Ib2363c5d50f5231cc89f287d760ca8728b02b249
This commit is contained in:
Kitta Koutarou
2019-02-14 19:16:40 +09:00
committed by Brad Ebinger
parent 68c7aad725
commit 994d27a2a5
2 changed files with 133 additions and 8 deletions

View File

@@ -90,6 +90,7 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment
private boolean mValidListener = false;
private boolean mEditableWfcMode = true;
private boolean mEditableWfcRoamingMode = true;
private boolean mUseWfcHomeModeForRoaming = false;
private int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
private ImsManager mImsManager;
@@ -317,6 +318,9 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment
CarrierConfigManager.KEY_EDITABLE_WFC_MODE_BOOL);
mEditableWfcRoamingMode = b.getBoolean(
CarrierConfigManager.KEY_EDITABLE_WFC_ROAMING_MODE_BOOL);
mUseWfcHomeModeForRoaming = b.getBoolean(
CarrierConfigManager.KEY_USE_WFC_HOME_NETWORK_MODE_IN_ROAMING_NETWORK_BOOL,
false);
isWifiOnlySupported = b.getBoolean(
CarrierConfigManager.KEY_CARRIER_WFC_SUPPORTS_WIFI_ONLY_BOOL, true);
}
@@ -499,7 +503,7 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment
// Don't show WFC (home) preference if it's not editable.
preferenceScreen.removePreference(mButtonWfcMode);
}
if (mEditableWfcRoamingMode) {
if (mEditableWfcRoamingMode && !mUseWfcHomeModeForRoaming) {
preferenceScreen.addPreference(mButtonWfcRoamingMode);
} else {
// Don't show WFC roaming preference if it's not editable.
@@ -528,10 +532,8 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment
mImsManager.setWfcMode(buttonMode, false);
mButtonWfcMode.setSummary(getWfcModeSummary(buttonMode));
mMetricsFeatureProvider.action(getActivity(), getMetricsCategory(), buttonMode);
}
if (!mEditableWfcRoamingMode) {
int currentWfcRoamingMode = mImsManager.getWfcMode(true);
if (buttonMode != currentWfcRoamingMode) {
if (mUseWfcHomeModeForRoaming) {
mImsManager.setWfcMode(buttonMode, true);
// mButtonWfcRoamingMode.setSummary is not needed; summary is selected value
}