use of com.android.internal.telephony.nano.TelephonyProto.ImsConnectionState in project android_frameworks_opt_telephony by LineageOS.
the class TelephonyMetrics method startNewSmsSessionIfNeeded.
/**
* Create the SMS session if there isn't any existing one
*
* @param phoneId Phone id
* @return The SMS session
*/
private synchronized InProgressSmsSession startNewSmsSessionIfNeeded(int phoneId) {
InProgressSmsSession smsSession = mInProgressSmsSessions.get(phoneId);
if (smsSession == null) {
if (VDBG)
Rlog.v(TAG, "Starting a new sms session on phone " + phoneId);
smsSession = new InProgressSmsSession(phoneId);
mInProgressSmsSessions.append(phoneId, smsSession);
// Insert the latest service state, ims capabilities, and ims connection state as the
// base.
TelephonyServiceState serviceState = mLastServiceState.get(phoneId);
if (serviceState != null) {
smsSession.addEvent(smsSession.startElapsedTimeMs, new SmsSessionEventBuilder(TelephonyCallSession.Event.Type.RIL_SERVICE_STATE_CHANGED).setServiceState(serviceState));
}
ImsCapabilities imsCapabilities = mLastImsCapabilities.get(phoneId);
if (imsCapabilities != null) {
smsSession.addEvent(smsSession.startElapsedTimeMs, new SmsSessionEventBuilder(SmsSession.Event.Type.IMS_CAPABILITIES_CHANGED).setImsCapabilities(imsCapabilities));
}
ImsConnectionState imsConnectionState = mLastImsConnectionState.get(phoneId);
if (imsConnectionState != null) {
smsSession.addEvent(smsSession.startElapsedTimeMs, new SmsSessionEventBuilder(SmsSession.Event.Type.IMS_CONNECTION_STATE_CHANGED).setImsConnectionState(imsConnectionState));
}
}
return smsSession;
}
use of com.android.internal.telephony.nano.TelephonyProto.ImsConnectionState in project android_frameworks_opt_telephony by LineageOS.
the class TelephonyMetrics method startNewSmsSession.
/**
* Create a new SMS session
*
* @param phoneId Phone id
* @return The SMS session
*/
private InProgressSmsSession startNewSmsSession(int phoneId) {
InProgressSmsSession smsSession = new InProgressSmsSession(phoneId);
// Insert the latest service state, ims capabilities, and ims connection state as the
// base.
TelephonyServiceState serviceState = mLastServiceState.get(phoneId);
if (serviceState != null) {
smsSession.addEvent(smsSession.startElapsedTimeMs, new SmsSessionEventBuilder(TelephonyCallSession.Event.Type.RIL_SERVICE_STATE_CHANGED).setServiceState(serviceState));
}
ImsCapabilities imsCapabilities = mLastImsCapabilities.get(phoneId);
if (imsCapabilities != null) {
smsSession.addEvent(smsSession.startElapsedTimeMs, new SmsSessionEventBuilder(SmsSession.Event.Type.IMS_CAPABILITIES_CHANGED).setImsCapabilities(imsCapabilities));
}
ImsConnectionState imsConnectionState = mLastImsConnectionState.get(phoneId);
if (imsConnectionState != null) {
smsSession.addEvent(smsSession.startElapsedTimeMs, new SmsSessionEventBuilder(SmsSession.Event.Type.IMS_CONNECTION_STATE_CHANGED).setImsConnectionState(imsConnectionState));
}
return smsSession;
}
use of com.android.internal.telephony.nano.TelephonyProto.ImsConnectionState in project android_frameworks_opt_telephony by LineageOS.
the class TelephonyMetrics method startNewCallSessionIfNeeded.
/**
* Create the call session if there isn't any existing one
*
* @param phoneId Phone id
* @return The call session
*/
private synchronized InProgressCallSession startNewCallSessionIfNeeded(int phoneId) {
InProgressCallSession callSession = mInProgressCallSessions.get(phoneId);
if (callSession == null) {
logv("Starting a new call session on phone " + phoneId);
callSession = new InProgressCallSession(phoneId);
mInProgressCallSessions.append(phoneId, callSession);
// Insert the latest service state, ims capabilities, and ims connection states as the
// base.
TelephonyServiceState serviceState = mLastServiceState.get(phoneId);
if (serviceState != null) {
callSession.addEvent(callSession.startElapsedTimeMs, new CallSessionEventBuilder(TelephonyCallSession.Event.Type.RIL_SERVICE_STATE_CHANGED).setServiceState(serviceState));
}
ImsCapabilities imsCapabilities = mLastImsCapabilities.get(phoneId);
if (imsCapabilities != null) {
callSession.addEvent(callSession.startElapsedTimeMs, new CallSessionEventBuilder(TelephonyCallSession.Event.Type.IMS_CAPABILITIES_CHANGED).setImsCapabilities(imsCapabilities));
}
ImsConnectionState imsConnectionState = mLastImsConnectionState.get(phoneId);
if (imsConnectionState != null) {
callSession.addEvent(callSession.startElapsedTimeMs, new CallSessionEventBuilder(TelephonyCallSession.Event.Type.IMS_CONNECTION_STATE_CHANGED).setImsConnectionState(imsConnectionState));
}
}
return callSession;
}
use of com.android.internal.telephony.nano.TelephonyProto.ImsConnectionState in project android_frameworks_opt_telephony by LineageOS.
the class TelephonyMetrics method writeOnImsConnectionState.
/**
* Write the IMS connection state changed event
*
* @param phoneId Phone id
* @param state IMS connection state
* @param reasonInfo The reason info. Only used for disconnected state.
*/
public synchronized void writeOnImsConnectionState(int phoneId, int state, ImsReasonInfo reasonInfo) {
ImsConnectionState imsState = new ImsConnectionState();
imsState.state = state;
if (reasonInfo != null) {
TelephonyProto.ImsReasonInfo ri = new TelephonyProto.ImsReasonInfo();
ri.reasonCode = reasonInfo.getCode();
ri.extraCode = reasonInfo.getExtraCode();
String extraMessage = reasonInfo.getExtraMessage();
if (extraMessage != null) {
ri.extraMessage = extraMessage;
}
imsState.reasonInfo = ri;
}
// If the connection state does not change, do not log it.
if (mLastImsConnectionState.get(phoneId) != null && Arrays.equals(ImsConnectionState.toByteArray(mLastImsConnectionState.get(phoneId)), ImsConnectionState.toByteArray(imsState))) {
return;
}
mLastImsConnectionState.put(phoneId, imsState);
TelephonyEvent event = new TelephonyEventBuilder(phoneId).setImsConnectionState(imsState).build();
addTelephonyEvent(event);
annotateInProgressCallSession(event.timestampMillis, phoneId, new CallSessionEventBuilder(TelephonyCallSession.Event.Type.IMS_CONNECTION_STATE_CHANGED).setImsConnectionState(event.imsConnectionState));
annotateInProgressSmsSession(event.timestampMillis, phoneId, new SmsSessionEventBuilder(SmsSession.Event.Type.IMS_CONNECTION_STATE_CHANGED).setImsConnectionState(event.imsConnectionState));
}
Aggregations