Merge "CallAttributes uses the call network type"
This commit is contained in:
@@ -177,8 +177,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
|
|
||||||
private ServiceState[] mServiceState;
|
private ServiceState[] mServiceState;
|
||||||
|
|
||||||
private int[] mNetworkType;
|
|
||||||
|
|
||||||
private int[] mVoiceActivationState;
|
private int[] mVoiceActivationState;
|
||||||
|
|
||||||
private int[] mDataActivationState;
|
private int[] mDataActivationState;
|
||||||
@@ -213,6 +211,9 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
private CallAttributes mCallAttributes = new CallAttributes(new PreciseCallState(),
|
private CallAttributes mCallAttributes = new CallAttributes(new PreciseCallState(),
|
||||||
TelephonyManager.NETWORK_TYPE_UNKNOWN, new CallQuality());
|
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[] mSrvccState;
|
||||||
|
|
||||||
private int mDefaultSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
private int mDefaultSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||||
@@ -374,7 +375,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
mDataConnectionNetworkType = new int[numPhones];
|
mDataConnectionNetworkType = new int[numPhones];
|
||||||
mCallIncomingNumber = new String[numPhones];
|
mCallIncomingNumber = new String[numPhones];
|
||||||
mServiceState = new ServiceState[numPhones];
|
mServiceState = new ServiceState[numPhones];
|
||||||
mNetworkType = new int[numPhones];
|
|
||||||
mVoiceActivationState = new int[numPhones];
|
mVoiceActivationState = new int[numPhones];
|
||||||
mDataActivationState = new int[numPhones];
|
mDataActivationState = new int[numPhones];
|
||||||
mUserMobileDataState = new boolean[numPhones];
|
mUserMobileDataState = new boolean[numPhones];
|
||||||
@@ -395,7 +395,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
mDataActivationState[i] = TelephonyManager.SIM_ACTIVATION_STATE_UNKNOWN;
|
mDataActivationState[i] = TelephonyManager.SIM_ACTIVATION_STATE_UNKNOWN;
|
||||||
mCallIncomingNumber[i] = "";
|
mCallIncomingNumber[i] = "";
|
||||||
mServiceState[i] = new ServiceState();
|
mServiceState[i] = new ServiceState();
|
||||||
mNetworkType[i] = mServiceState[i].getVoiceNetworkType();
|
|
||||||
mSignalStrength[i] = new SignalStrength();
|
mSignalStrength[i] = new SignalStrength();
|
||||||
mUserMobileDataState[i] = false;
|
mUserMobileDataState[i] = false;
|
||||||
mMessageWaiting[i] = false;
|
mMessageWaiting[i] = false;
|
||||||
@@ -997,21 +996,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
if (validatePhoneId(phoneId)) {
|
if (validatePhoneId(phoneId)) {
|
||||||
mServiceState[phoneId] = state;
|
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) {
|
for (Record r : mRecords) {
|
||||||
if (VDBG) {
|
if (VDBG) {
|
||||||
log("notifyServiceStateForSubscriber: r=" + r + " subId=" + subId
|
log("notifyServiceStateForSubscriber: r=" + r + " subId=" + subId
|
||||||
@@ -1039,14 +1023,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
mRemoveList.add(r.binder);
|
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 {
|
} else {
|
||||||
log("notifyServiceStateForSubscriber: INVALID phoneId=" + phoneId);
|
log("notifyServiceStateForSubscriber: INVALID phoneId=" + phoneId);
|
||||||
@@ -1573,7 +1549,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
log("notifyPreciseCallState: mCallQuality is null, skipping call attributes");
|
log("notifyPreciseCallState: mCallQuality is null, skipping call attributes");
|
||||||
notifyCallAttributes = false;
|
notifyCallAttributes = false;
|
||||||
} else {
|
} else {
|
||||||
mCallAttributes = new CallAttributes(mPreciseCallState, mNetworkType[phoneId],
|
mCallAttributes = new CallAttributes(mPreciseCallState, mCallNetworkType,
|
||||||
mCallQuality);
|
mCallQuality);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1840,16 +1816,16 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void notifyCallQualityChanged(CallQuality callQuality, int phoneId) {
|
public void notifyCallQualityChanged(CallQuality callQuality, int phoneId,
|
||||||
|
int callNetworkType) {
|
||||||
if (!checkNotifyPermission("notifyCallQualityChanged()")) {
|
if (!checkNotifyPermission("notifyCallQualityChanged()")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// merge CallQuality with PreciseCallState and network type
|
// merge CallQuality with PreciseCallState and network type
|
||||||
mCallQuality = callQuality;
|
mCallQuality = callQuality;
|
||||||
mCallAttributes = new CallAttributes(mPreciseCallState,
|
mCallNetworkType = callNetworkType;
|
||||||
mNetworkType[phoneId],
|
mCallAttributes = new CallAttributes(mPreciseCallState, callNetworkType, callQuality);
|
||||||
callQuality);
|
|
||||||
|
|
||||||
synchronized (mRecords) {
|
synchronized (mRecords) {
|
||||||
TelephonyManager tm = (TelephonyManager) mContext.getSystemService(
|
TelephonyManager tm = (TelephonyManager) mContext.getSystemService(
|
||||||
@@ -1886,7 +1862,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
pw.println("mCallState=" + mCallState[i]);
|
pw.println("mCallState=" + mCallState[i]);
|
||||||
pw.println("mCallIncomingNumber=" + mCallIncomingNumber[i]);
|
pw.println("mCallIncomingNumber=" + mCallIncomingNumber[i]);
|
||||||
pw.println("mServiceState=" + mServiceState[i]);
|
pw.println("mServiceState=" + mServiceState[i]);
|
||||||
pw.println("mNetworkType=" + mNetworkType[i]);
|
|
||||||
pw.println("mVoiceActivationState= " + mVoiceActivationState[i]);
|
pw.println("mVoiceActivationState= " + mVoiceActivationState[i]);
|
||||||
pw.println("mDataActivationState= " + mDataActivationState[i]);
|
pw.println("mDataActivationState= " + mDataActivationState[i]);
|
||||||
pw.println("mUserMobileDataState= " + mUserMobileDataState[i]);
|
pw.println("mUserMobileDataState= " + mUserMobileDataState[i]);
|
||||||
@@ -1900,6 +1875,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
|||||||
pw.println("mImsCallDisconnectCause=" + mImsReasonInfo.get(i).toString());
|
pw.println("mImsCallDisconnectCause=" + mImsReasonInfo.get(i).toString());
|
||||||
pw.decreaseIndent();
|
pw.decreaseIndent();
|
||||||
}
|
}
|
||||||
|
pw.println("mCallNetworkType=" + mCallNetworkType);
|
||||||
pw.println("mPreciseDataConnectionState=" + mPreciseDataConnectionState);
|
pw.println("mPreciseDataConnectionState=" + mPreciseDataConnectionState);
|
||||||
pw.println("mPreciseCallState=" + mPreciseCallState);
|
pw.println("mPreciseCallState=" + mPreciseCallState);
|
||||||
pw.println("mCallDisconnectCause=" + mCallDisconnectCause);
|
pw.println("mCallDisconnectCause=" + mCallDisconnectCause);
|
||||||
|
|||||||
@@ -84,6 +84,6 @@ interface ITelephonyRegistry {
|
|||||||
void notifyPreferredDataSubIdChanged(int preferredSubId);
|
void notifyPreferredDataSubIdChanged(int preferredSubId);
|
||||||
void notifyRadioPowerStateChanged(in int state);
|
void notifyRadioPowerStateChanged(in int state);
|
||||||
void notifyEmergencyNumberList();
|
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);
|
void notifyImsDisconnectCause(int subId, in ImsReasonInfo imsReasonInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user