Search in sources :

Example 1 with TelephonySettings

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

the class TelephonyMetrics method writeImsSetFeatureValue.

/**
 * Write IMS feature settings changed event
 *
 * @param phoneId Phone id
 * @param feature IMS feature
 * @param network The IMS network type
 * @param value The settings. 0 indicates disabled, otherwise enabled.
 * @param status IMS operation status. See OperationStatusConstants for details.
 */
public void writeImsSetFeatureValue(int phoneId, int feature, int network, int value, int status) {
    TelephonySettings s = new TelephonySettings();
    switch(feature) {
        case ImsConfig.FeatureConstants.FEATURE_TYPE_VOICE_OVER_LTE:
            s.isEnhanced4GLteModeEnabled = (value != 0);
            break;
        case ImsConfig.FeatureConstants.FEATURE_TYPE_VOICE_OVER_WIFI:
            s.isWifiCallingEnabled = (value != 0);
            break;
        case ImsConfig.FeatureConstants.FEATURE_TYPE_VIDEO_OVER_LTE:
            s.isVtOverLteEnabled = (value != 0);
            break;
        case ImsConfig.FeatureConstants.FEATURE_TYPE_VIDEO_OVER_WIFI:
            s.isVtOverWifiEnabled = (value != 0);
            break;
    }
    // If the settings don't change, we don't log the event.
    if (mLastSettings.get(phoneId) != null && Arrays.equals(TelephonySettings.toByteArray(mLastSettings.get(phoneId)), TelephonySettings.toByteArray(s))) {
        return;
    }
    mLastSettings.put(phoneId, s);
    TelephonyEvent event = new TelephonyEventBuilder(phoneId).setSettings(s).build();
    addTelephonyEvent(event);
    annotateInProgressCallSession(event.timestampMillis, phoneId, new CallSessionEventBuilder(TelephonyCallSession.Event.Type.SETTINGS_CHANGED).setSettings(s));
    annotateInProgressSmsSession(event.timestampMillis, phoneId, new SmsSessionEventBuilder(SmsSession.Event.Type.SETTINGS_CHANGED).setSettings(s));
}
Also used : TelephonyEvent(com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent) TelephonySettings(com.android.internal.telephony.nano.TelephonyProto.TelephonySettings)

Example 2 with TelephonySettings

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

the class TelephonyMetrics method writeSetPreferredNetworkType.

/**
 * Write the preferred network settings changed event
 *
 * @param phoneId Phone id
 * @param networkType The preferred network
 */
public void writeSetPreferredNetworkType(int phoneId, int networkType) {
    TelephonySettings s = new TelephonySettings();
    s.preferredNetworkMode = networkType + 1;
    // If the settings don't change, we don't log the event.
    if (mLastSettings.get(phoneId) != null && Arrays.equals(TelephonySettings.toByteArray(mLastSettings.get(phoneId)), TelephonySettings.toByteArray(s))) {
        return;
    }
    mLastSettings.put(phoneId, s);
    addTelephonyEvent(new TelephonyEventBuilder(phoneId).setSettings(s).build());
}
Also used : TelephonySettings(com.android.internal.telephony.nano.TelephonyProto.TelephonySettings)

Aggregations

TelephonySettings (com.android.internal.telephony.nano.TelephonyProto.TelephonySettings)2 TelephonyEvent (com.android.internal.telephony.nano.TelephonyProto.TelephonyEvent)1