diff options
author | Etan Cohen <etancohen@google.com> | 2014-09-27 06:12:08 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-27 06:12:08 +0000 |
commit | 96117a717616b1d3fbf1129084b3b7f4c35b456d (patch) | |
tree | b5b303a35773f9551b8be80ba4e3ba0bb61d4795 /telephony/java/android | |
parent | 14b606afaf8ca16ad855529ebe4b3cc504529306 (diff) | |
parent | 590163ef312a77f7f4d658a95ce318d357dbd342 (diff) | |
download | frameworks_base-96117a717616b1d3fbf1129084b3b7f4c35b456d.zip frameworks_base-96117a717616b1d3fbf1129084b3b7f4c35b456d.tar.gz frameworks_base-96117a717616b1d3fbf1129084b3b7f4c35b456d.tar.bz2 |
am 07719bb5: am 2b267872: Added mechanism to merge voice & baseline ServiceState objects.
* commit '07719bb58313a78af087495874358dc4f22b9098':
Added mechanism to merge voice & baseline ServiceState objects.
Diffstat (limited to 'telephony/java/android')
-rw-r--r-- | telephony/java/android/telephony/ServiceState.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index 1ee390f..ce89538 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -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; + } } |