am 96117a71: am 07719bb5: am 2b267872: Added mechanism to merge voice & baseline ServiceState objects.

* commit '96117a717616b1d3fbf1129084b3b7f4c35b456d':
  Added mechanism to merge voice & baseline ServiceState objects.
This commit is contained in:
Etan Cohen
2014-09-29 19:47:02 +00:00
committed by Android Git Automerger

View File

@@ -861,4 +861,23 @@ public class ServiceState implements Parcelable {
|| radioTechnology == RIL_RADIO_TECHNOLOGY_EVDO_B
|| radioTechnology == RIL_RADIO_TECHNOLOGY_EHRPD;
}
/**
* Returns a merged ServiceState consisting of the base SS with voice settings from the
* voice SS. The voice SS is only used if it is IN_SERVICE (otherwise the base SS is returned).
* @hide
* */
public static ServiceState mergeServiceStates(ServiceState baseSs, ServiceState voiceSs) {
if (voiceSs.mVoiceRegState != STATE_IN_SERVICE) {
return baseSs;
}
ServiceState newSs = new ServiceState(baseSs);
// voice overrides
newSs.mVoiceRegState = voiceSs.mVoiceRegState;
newSs.mIsEmergencyOnly = false; // only get here if voice is IN_SERVICE
return newSs;
}
}