Call DataSettingsManager to determine dafault data roaming in PIM
This cl replaces a internal private method in PhoneInterfaceManager
with calling DataSettingsManager.isDefaultDataRoamingEnabled to
determine the default data roaming value when resetting telephony.
It removes the duplication logic and possible inconsistency.
Bug: 136008634
Test: FrameworksTelephonyTests
Test: Telephony factory reset
Flag: EXEMPT (minior refactor without logic change)
Change-Id: Ia1316794f2c915804e48f6b119ff907c1a1dd60e
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 839d8cb..e18818c 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -8504,7 +8504,8 @@
setNetworkSelectionModeAutomatic(subId);
Phone phone = getPhone(subId);
cleanUpAllowedNetworkTypes(phone, subId);
- setDataRoamingEnabled(subId, getDefaultDataRoamingEnabled(subId));
+ setDataRoamingEnabled(subId, phone == null ? false
+ : phone.getDataSettingsManager().isDefaultDataRoamingEnabled());
getPhone(subId).resetCarrierKeysForImsiEncryption();
}
// There has been issues when Sms raw table somehow stores orphan
@@ -10107,20 +10108,6 @@
}
/**
- * Returns true if the data roaming is enabled by default, i.e the system property
- * of {@link #DEFAULT_DATA_ROAMING_PROPERTY_NAME} is true or the config of
- * {@link CarrierConfigManager#KEY_CARRIER_DEFAULT_DATA_ROAMING_ENABLED_BOOL} is true.
- */
- private boolean getDefaultDataRoamingEnabled(int subId) {
- final CarrierConfigManager configMgr = (CarrierConfigManager)
- mApp.getSystemService(Context.CARRIER_CONFIG_SERVICE);
- boolean isDataRoamingEnabled = TelephonyProperties.data_roaming().orElse(false);
- isDataRoamingEnabled |= configMgr.getConfigForSubId(subId).getBoolean(
- CarrierConfigManager.KEY_CARRIER_DEFAULT_DATA_ROAMING_ENABLED_BOOL);
- return isDataRoamingEnabled;
- }
-
- /**
* Returns the default network type for the given {@code subId}, if the default network type is
* not set, return {@link Phone#PREFERRED_NT_MODE}.
*/