Search in sources :

Example 1 with SmsSession

use of com.android.internal.telephony.nano.TelephonyProto.SmsSession 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();
}
Also used : TelephonyEvent(com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent) TelephonyCallSession(com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession) IndentingPrintWriter(com.android.internal.util.IndentingPrintWriter) RilCall(com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.RilCall) SmsSession(com.android.internal.telephony.nano.TelephonyProto.SmsSession)

Example 2 with SmsSession

use of com.android.internal.telephony.nano.TelephonyProto.SmsSession in project android_frameworks_opt_telephony by LineageOS.

the class TelephonyMetrics method finishSmsSessionIfNeeded.

/**
 * Finish the SMS session and move it into the completed session
 *
 * @param inProgressSmsSession The in progress SMS session
 */
private synchronized void finishSmsSessionIfNeeded(InProgressSmsSession inProgressSmsSession) {
    if (inProgressSmsSession.getNumExpectedResponses() == 0) {
        SmsSession smsSession = new SmsSession();
        smsSession.events = new SmsSession.Event[inProgressSmsSession.events.size()];
        inProgressSmsSession.events.toArray(smsSession.events);
        smsSession.startTimeMinutes = inProgressSmsSession.startSystemTimeMin;
        smsSession.phoneId = inProgressSmsSession.phoneId;
        smsSession.eventsDropped = inProgressSmsSession.isEventsDropped();
        if (mCompletedSmsSessions.size() >= MAX_COMPLETED_SMS_SESSIONS) {
            mCompletedSmsSessions.removeFirst();
        }
        mCompletedSmsSessions.add(smsSession);
        mInProgressSmsSessions.remove(inProgressSmsSession.phoneId);
        if (VDBG)
            Rlog.v(TAG, "SMS session finished");
    }
}
Also used : SmsSession(com.android.internal.telephony.nano.TelephonyProto.SmsSession)

Aggregations

SmsSession (com.android.internal.telephony.nano.TelephonyProto.SmsSession)2 TelephonyCallSession (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession)1 RilCall (com.android.internal.telephony.nano.TelephonyProto.TelephonyCallSession.Event.RilCall)1 TelephonyEvent (com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent)1 IndentingPrintWriter (com.android.internal.util.IndentingPrintWriter)1