diff options
author | Jordan Liu <jminjie@google.com> | 2019-02-25 23:26:31 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-02-25 23:26:31 -0800 |
commit | a9ff4b51a9ce9c1b5dd23cb19fc86b377a6d6c75 (patch) | |
tree | 4ae37c3e82511ee7e1abf4a154697ffbb0903822 | |
parent | 3b7debb0d623611eefbae33d75f4d2c32c5d273e (diff) | |
parent | f097910b87cd6ce09a943ec35f0829bddabaf265 (diff) |
Merge "CallAttributes uses the call network type" am: 0a04598a39
am: f097910b87
Change-Id: Idb6d487bd77830ed849e4dda4eec3eaa2afcf48e
-rw-r--r-- | services/core/java/com/android/server/TelephonyRegistry.java | 42 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl | 2 |
2 files changed, 10 insertions, 34 deletions
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index 3b5c9f53d9a1..b4d45d475917 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -177,8 +177,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { private ServiceState[] mServiceState; - private int[] mNetworkType; - private int[] mVoiceActivationState; private int[] mDataActivationState; @@ -213,6 +211,9 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { private CallAttributes mCallAttributes = new CallAttributes(new PreciseCallState(), TelephonyManager.NETWORK_TYPE_UNKNOWN, new CallQuality()); + // network type of the call associated with the mCallAttributes and mCallQuality + private int mCallNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN; + private int[] mSrvccState; private int mDefaultSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; @@ -374,7 +375,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { mDataConnectionNetworkType = new int[numPhones]; mCallIncomingNumber = new String[numPhones]; mServiceState = new ServiceState[numPhones]; - mNetworkType = new int[numPhones]; mVoiceActivationState = new int[numPhones]; mDataActivationState = new int[numPhones]; mUserMobileDataState = new boolean[numPhones]; @@ -395,7 +395,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { mDataActivationState[i] = TelephonyManager.SIM_ACTIVATION_STATE_UNKNOWN; mCallIncomingNumber[i] = ""; mServiceState[i] = new ServiceState(); - mNetworkType[i] = mServiceState[i].getVoiceNetworkType(); mSignalStrength[i] = new SignalStrength(); mUserMobileDataState[i] = false; mMessageWaiting[i] = false; @@ -997,21 +996,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { if (validatePhoneId(phoneId)) { mServiceState[phoneId] = state; - boolean notifyCallAttributes = true; - if (mNetworkType[phoneId] != mServiceState[phoneId].getVoiceNetworkType()) { - mNetworkType[phoneId] = state.getVoiceNetworkType(); - mCallAttributes = new CallAttributes(mPreciseCallState, mNetworkType[phoneId], - mCallQuality); - } else { - // No change to network type, so no need to notify call attributes - notifyCallAttributes = false; - } - - if (mCallQuality == null) { - // No call quality reported yet, so no need to notify call attributes - notifyCallAttributes = false; - } - for (Record r : mRecords) { if (VDBG) { log("notifyServiceStateForSubscriber: r=" + r + " subId=" + subId @@ -1039,14 +1023,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { mRemoveList.add(r.binder); } } - if (notifyCallAttributes && r.matchPhoneStateListenerEvent( - PhoneStateListener.LISTEN_CALL_ATTRIBUTES_CHANGED)) { - try { - r.callback.onCallAttributesChanged(mCallAttributes); - } catch (RemoteException ex) { - mRemoveList.add(r.binder); - } - } } } else { log("notifyServiceStateForSubscriber: INVALID phoneId=" + phoneId); @@ -1573,7 +1549,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { log("notifyPreciseCallState: mCallQuality is null, skipping call attributes"); notifyCallAttributes = false; } else { - mCallAttributes = new CallAttributes(mPreciseCallState, mNetworkType[phoneId], + mCallAttributes = new CallAttributes(mPreciseCallState, mCallNetworkType, mCallQuality); } @@ -1840,16 +1816,16 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { } @Override - public void notifyCallQualityChanged(CallQuality callQuality, int phoneId) { + public void notifyCallQualityChanged(CallQuality callQuality, int phoneId, + int callNetworkType) { if (!checkNotifyPermission("notifyCallQualityChanged()")) { return; } // merge CallQuality with PreciseCallState and network type mCallQuality = callQuality; - mCallAttributes = new CallAttributes(mPreciseCallState, - mNetworkType[phoneId], - callQuality); + mCallNetworkType = callNetworkType; + mCallAttributes = new CallAttributes(mPreciseCallState, callNetworkType, callQuality); synchronized (mRecords) { TelephonyManager tm = (TelephonyManager) mContext.getSystemService( @@ -1886,7 +1862,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { pw.println("mCallState=" + mCallState[i]); pw.println("mCallIncomingNumber=" + mCallIncomingNumber[i]); pw.println("mServiceState=" + mServiceState[i]); - pw.println("mNetworkType=" + mNetworkType[i]); pw.println("mVoiceActivationState= " + mVoiceActivationState[i]); pw.println("mDataActivationState= " + mDataActivationState[i]); pw.println("mUserMobileDataState= " + mUserMobileDataState[i]); @@ -1900,6 +1875,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { pw.println("mImsCallDisconnectCause=" + mImsReasonInfo.get(i).toString()); pw.decreaseIndent(); } + pw.println("mCallNetworkType=" + mCallNetworkType); pw.println("mPreciseDataConnectionState=" + mPreciseDataConnectionState); pw.println("mPreciseCallState=" + mPreciseCallState); pw.println("mCallDisconnectCause=" + mCallDisconnectCause); diff --git a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl index e9eba324acb0..5719124fd747 100644 --- a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl @@ -84,6 +84,6 @@ interface ITelephonyRegistry { void notifyPreferredDataSubIdChanged(int preferredSubId); void notifyRadioPowerStateChanged(in int state); void notifyEmergencyNumberList(); - void notifyCallQualityChanged(in CallQuality callQuality, int phoneId); + void notifyCallQualityChanged(in CallQuality callQuality, int phoneId, int callNetworkType); void notifyImsDisconnectCause(int subId, in ImsReasonInfo imsReasonInfo); } |