Have getSupportedModemCount always rely on system properties.
Earlier we disabled the reboot free feature and always have getSupportedModemCount return the same value with getActiveModemCount. Now that we've enbaled reboot free switch, we will return correct value based on system property. Bug: 142514392 Test: manual - change PROPERTY_REBOOT_REQUIRED_ON_MODEM_CHANGE and test what getSupportedModemCount returns. Change-Id: I34e172c747dd52aa498037e64b758393793fddba
This commit is contained in:
@@ -424,18 +424,8 @@ public class TelephonyManager {
|
||||
* {@link #getActiveModemCount} returns 1 while this API returns 2.
|
||||
*/
|
||||
public @ModemCount int getSupportedModemCount() {
|
||||
// TODO: b/139642279 when turning on this feature, remove dependency of
|
||||
// PROPERTY_REBOOT_REQUIRED_ON_MODEM_CHANGE and always return result based on
|
||||
// PROPERTY_MAX_ACTIVE_MODEMS.
|
||||
String rebootRequired = SystemProperties.get(
|
||||
TelephonyProperties.PROPERTY_REBOOT_REQUIRED_ON_MODEM_CHANGE);
|
||||
if (rebootRequired.equals("false")) {
|
||||
// If no reboot is required, return max possible active modems.
|
||||
return SystemProperties.getInt(
|
||||
TelephonyProperties.PROPERTY_MAX_ACTIVE_MODEMS, getPhoneCount());
|
||||
} else {
|
||||
return getPhoneCount();
|
||||
}
|
||||
return SystemProperties.getInt(TelephonyProperties.PROPERTY_MAX_ACTIVE_MODEMS,
|
||||
getActiveModemCount());
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
|
||||
Reference in New Issue
Block a user