Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit faadb975 authored by Muhammad Qureshi's avatar Muhammad Qureshi
Browse files

Migrate to TelecomStatsLog from StatsLog

As part of statsd becoming a Mainline module in R, autogenerated
StatsLog.write() calls are going away and replaced by *StatsLog.java
that is autogenerated for each module.
This CL adds autogenerated TelecomStatsLog and replaces usages
of StatsLog with TelecomStatsLog.

Bug: 145952197
Test: m
Test: atest TelecomUnitTests
Change-Id: Idd9ed343a596336b7c56b705cb521c14a7ff2716
parent 6ad0c844
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
genrule {
    name: "statslog-telecom-java-gen",
    tools: ["stats-log-api-gen"],
    cmd: "$(location stats-log-api-gen) --java $(out) --module telecom"
        + " --javaPackage com.android.server.telecom --javaClass TelecomStatsLog",
    out: ["com/android/server/telecom/TelecomStatsLog.java"],
}

filegroup {
    name: "Telecom-srcs",
    srcs: [
        "src/**/*.java",
        ":statslog-telecom-java-gen",
    ],
}

// Build the Telecom service.
android_app {
    name: "Telecom",
    srcs: [
        "src/**/*.java",
        ":Telecom-srcs",
        "proto/**/*.proto",
    ],
    resource_dirs: ["res"],
@@ -36,7 +52,7 @@ android_test {
    ],
    srcs: [
        "tests/src/**/*.java",
        "src/**/*.java",
        ":Telecom-srcs",
        "proto/**/*.proto",
    ],
    proto: {
+5 −6
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ import android.telephony.PhoneNumberUtils;
import android.telephony.TelephonyManager;
import android.telephony.emergency.EmergencyNumber;
import android.text.TextUtils;
import android.util.StatsLog;
import android.widget.Toast;

import com.android.internal.annotations.VisibleForTesting;
@@ -1067,8 +1066,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
            }
            int statsdDisconnectCause = (newState == CallState.DISCONNECTED) ?
                    getDisconnectCause().getCode() : DisconnectCause.UNKNOWN;
            StatsLog.write(StatsLog.CALL_STATE_CHANGED, newState, statsdDisconnectCause,
                    isSelfManaged(), isExternalCall());
            TelecomStatsLog.write(TelecomStatsLog.CALL_STATE_CHANGED, newState,
                    statsdDisconnectCause, isSelfManaged(), isExternalCall());
        }
        return true;
    }