Search in sources :

Example 1 with ImsCapabilities

use of com.android.internal.telephony.nano.TelephonyProto.ImsCapabilities 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;
}
Also used : TelephonyServiceState(com.android.internal.telephony.nano.TelephonyProto.TelephonyServiceState) ImsConnectionState(com.android.internal.telephony.nano.TelephonyProto.ImsConnectionState) ImsCapabilities(com.android.internal.telephony.nano.TelephonyProto.ImsCapabilities)

Example 2 with ImsCapabilities

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

the class TelephonyMetrics method writeOnImsCapabilities.

/**
 * Write the IMS capabilities changed event
 *
 * @param phoneId Phone id
 * @param capabilities IMS capabilities array
 */
public synchronized void writeOnImsCapabilities(int phoneId, boolean[] capabilities) {
    ImsCapabilities cap = new ImsCapabilities();
    cap.voiceOverLte = capabilities[0];
    cap.videoOverLte = capabilities[1];
    cap.voiceOverWifi = capabilities[2];
    cap.videoOverWifi = capabilities[3];
    cap.utOverLte = capabilities[4];
    cap.utOverWifi = capabilities[5];
    TelephonyEvent event = new TelephonyEventBuilder(phoneId).setImsCapabilities(cap).build();
    // If the capabilities don't change, we don't log the event.
    if (mLastImsCapabilities.get(phoneId) != null && Arrays.equals(ImsCapabilities.toByteArray(mLastImsCapabilities.get(phoneId)), ImsCapabilities.toByteArray(cap))) {
        return;
    }
    mLastImsCapabilities.put(phoneId, cap);
    addTelephonyEvent(event);
    annotateInProgressCallSession(event.timestampMillis, phoneId, new CallSessionEventBuilder(TelephonyCallSession.Event.Type.IMS_CAPABILITIES_CHANGED).setImsCapabilities(event.imsCapabilities));
    annotateInProgressSmsSession(event.timestampMillis, phoneId, new SmsSessionEventBuilder(SmsSession.Event.Type.IMS_CAPABILITIES_CHANGED).setImsCapabilities(event.imsCapabilities));
}
Also used : TelephonyEvent(com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent) ImsCapabilities(com.android.internal.telephony.nano.TelephonyProto.ImsCapabilities)

Example 3 with ImsCapabilities

use of com.android.internal.telephony.nano.TelephonyProto.ImsCapabilities 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;
}
Also used : TelephonyServiceState(com.android.internal.telephony.nano.TelephonyProto.TelephonyServiceState) ImsConnectionState(com.android.internal.telephony.nano.TelephonyProto.ImsConnectionState) ImsCapabilities(com.android.internal.telephony.nano.TelephonyProto.ImsCapabilities)

Example 4 with ImsCapabilities

use of com.android.internal.telephony.nano.TelephonyProto.ImsCapabilities 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;
}
Also used : TelephonyServiceState(com.android.internal.telephony.nano.TelephonyProto.TelephonyServiceState) ImsConnectionState(com.android.internal.telephony.nano.TelephonyProto.ImsConnectionState) ImsCapabilities(com.android.internal.telephony.nano.TelephonyProto.ImsCapabilities)

Example 5 with ImsCapabilities

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

the class TelephonyMetrics method writeOnImsCapabilities.

/**
 * Write the IMS capabilities changed event
 *
 * @param phoneId Phone id
 * @param capabilities IMS capabilities array
 */
public synchronized void writeOnImsCapabilities(int phoneId, @ImsRegistrationImplBase.ImsRegistrationTech int radioTech, MmTelFeature.MmTelCapabilities capabilities) {
    ImsCapabilities cap = new ImsCapabilities();
    if (radioTech == ImsRegistrationImplBase.REGISTRATION_TECH_LTE) {
        cap.voiceOverLte = capabilities.isCapable(MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_VOICE);
        cap.videoOverLte = capabilities.isCapable(MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_VIDEO);
        cap.utOverLte = capabilities.isCapable(MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_UT);
    } else if (radioTech == ImsRegistrationImplBase.REGISTRATION_TECH_IWLAN) {
        cap.voiceOverWifi = capabilities.isCapable(MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_VOICE);
        cap.videoOverWifi = capabilities.isCapable(MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_VIDEO);
        cap.utOverWifi = capabilities.isCapable(MmTelFeature.MmTelCapabilities.CAPABILITY_TYPE_UT);
    }
    TelephonyEvent event = new TelephonyEventBuilder(phoneId).setImsCapabilities(cap).build();
    // If the capabilities don't change, we don't log the event.
    if (mLastImsCapabilities.get(phoneId) != null && Arrays.equals(ImsCapabilities.toByteArray(mLastImsCapabilities.get(phoneId)), ImsCapabilities.toByteArray(cap))) {
        return;
    }
    mLastImsCapabilities.put(phoneId, cap);
    addTelephonyEvent(event);
    annotateInProgressCallSession(event.timestampMillis, phoneId, new CallSessionEventBuilder(TelephonyCallSession.Event.Type.IMS_CAPABILITIES_CHANGED).setImsCapabilities(event.imsCapabilities));
    annotateInProgressSmsSession(event.timestampMillis, phoneId, new SmsSessionEventBuilder(SmsSession.Event.Type.IMS_CAPABILITIES_CHANGED).setImsCapabilities(event.imsCapabilities));
}
Also used : TelephonyEvent(com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent) ImsCapabilities(com.android.internal.telephony.nano.TelephonyProto.ImsCapabilities)

Aggregations

ImsCapabilities (com.android.internal.telephony.nano.TelephonyProto.ImsCapabilities)5 ImsConnectionState (com.android.internal.telephony.nano.TelephonyProto.ImsConnectionState)3 TelephonyServiceState (com.android.internal.telephony.nano.TelephonyProto.TelephonyServiceState)3 TelephonyEvent (com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent)2