summaryrefslogtreecommitdiffstats
path: root/telephony/java/android/telephony/ServiceState.java
diff options
context:
space:
mode:
authorEtan Cohen <etancohen@google.com>2014-09-23 16:03:44 -0700
committerEtan Cohen <etancohen@google.com>2014-09-27 04:55:28 +0000
commitdcc0736c4341335dc73856d98ac940c2ad7eba8f (patch)
tree542d657553f4c9e8f2fd497e1b653d32ce6c0e40 /telephony/java/android/telephony/ServiceState.java
parent6e2bba7d34adab1e4327cd15a3d506e61fffa777 (diff)
downloadframeworks_base-dcc0736c4341335dc73856d98ac940c2ad7eba8f.zip
frameworks_base-dcc0736c4341335dc73856d98ac940c2ad7eba8f.tar.gz
frameworks_base-dcc0736c4341335dc73856d98ac940c2ad7eba8f.tar.bz2
Added mechanism to merge voice & baseline ServiceState objects.
Needed in the context of separate phones handling baseline connectivity and voice connectivity (e.g. IMS). Bug: 17627405 Change-Id: Ifb5a6ea11f6350090b989408e9eed80958d8558b
Diffstat (limited to 'telephony/java/android/telephony/ServiceState.java')
-rw-r--r--telephony/java/android/telephony/ServiceState.java19
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;
+ }
}