use of com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession in project android_frameworks_opt_telephony by LineageOS.
the class TelephonyMetrics method finishCallSession.
/**
* Finish the call session and move it into the completed session
*
* @param inProgressCallSession The in progress call session
*/
private synchronized void finishCallSession(InProgressCallSession inProgressCallSession) {
TelephonyCallSession callSession = new TelephonyCallSession();
callSession.events = new TelephonyCallSession.Event[inProgressCallSession.events.size()];
inProgressCallSession.events.toArray(callSession.events);
callSession.startTimeMinutes = inProgressCallSession.startSystemTimeMin;
callSession.phoneId = inProgressCallSession.phoneId;
callSession.eventsDropped = inProgressCallSession.isEventsDropped();
if (mCompletedCallSessions.size() >= MAX_COMPLETED_CALL_SESSIONS) {
mCompletedCallSessions.removeFirst();
}
mCompletedCallSessions.add(callSession);
mInProgressCallSessions.remove(inProgressCallSession.phoneId);
if (VDBG)
Rlog.v(TAG, "Call session finished");
}
use of com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession in project android_frameworks_opt_telephony by LineageOS.
the class TelephonyMetrics method printAllMetrics.
/**
* Print all metrics data for debugging purposes
*
* @param rawWriter Print writer
*/
private synchronized void printAllMetrics(PrintWriter rawWriter) {
final IndentingPrintWriter pw = new IndentingPrintWriter(rawWriter, " ");
pw.println("Telephony metrics proto:");
pw.println("------------------------------------------");
pw.println("Telephony events:");
pw.increaseIndent();
for (TelephonyEvent event : mTelephonyEvents) {
pw.print(event.timestampMillis);
pw.print(" [");
pw.print(event.phoneId);
pw.print("] ");
pw.print("T=");
if (event.type == TelephonyEvent.Type.RIL_SERVICE_STATE_CHANGED) {
pw.print(telephonyEventToString(event.type) + "(" + event.serviceState.dataRat + ")");
} else {
pw.print(telephonyEventToString(event.type));
}
pw.println("");
}
pw.decreaseIndent();
pw.println("Call sessions:");
pw.increaseIndent();
for (TelephonyCallSession callSession : mCompletedCallSessions) {
pw.println("Start time in minutes: " + callSession.startTimeMinutes);
pw.println("Events dropped: " + callSession.eventsDropped);
pw.println("Events: ");
pw.increaseIndent();
for (TelephonyCallSession.Event event : callSession.events) {
pw.print(event.delay);
pw.print(" T=");
if (event.type == TelephonyCallSession.Event.Type.RIL_SERVICE_STATE_CHANGED) {
pw.println(callSessionEventToString(event.type) + "(" + event.serviceState.dataRat + ")");
} else if (event.type == TelephonyCallSession.Event.Type.RIL_CALL_LIST_CHANGED) {
pw.println(callSessionEventToString(event.type));
pw.increaseIndent();
for (RilCall call : event.calls) {
pw.println(call.index + ". Type = " + call.type + " State = " + call.state + " End Reason " + call.callEndReason + " isMultiparty = " + call.isMultiparty);
}
pw.decreaseIndent();
} else {
pw.println(callSessionEventToString(event.type));
}
}
pw.decreaseIndent();
}
pw.decreaseIndent();
pw.println("Sms sessions:");
pw.increaseIndent();
int count = 0;
for (SmsSession smsSession : mCompletedSmsSessions) {
count++;
pw.print("[" + count + "] Start time in minutes: " + smsSession.startTimeMinutes);
if (smsSession.eventsDropped) {
pw.println(", events dropped: " + smsSession.eventsDropped);
}
pw.println("Events: ");
pw.increaseIndent();
for (SmsSession.Event event : smsSession.events) {
pw.print(event.delay);
pw.print(" T=");
pw.println(smsSessionEventToString(event.type));
}
pw.decreaseIndent();
}
pw.decreaseIndent();
}
Aggregations