Log TelephonyAnomalyDetected event from AnomalyReporter
Bug: 188462677 Test: inspected atoms after triggering anomaly Change-Id: Ic3d8a6fd5c7942214278ea8812dffd8c5b8362a3
This commit is contained in:
@@ -13,6 +13,15 @@ filegroup {
|
||||
srcs: [
|
||||
"**/*.java",
|
||||
"**/*.aidl",
|
||||
":statslog-telephony-java-gen",
|
||||
],
|
||||
visibility: ["//frameworks/base"],
|
||||
}
|
||||
|
||||
genrule {
|
||||
name: "statslog-telephony-java-gen",
|
||||
tools: ["stats-log-api-gen"],
|
||||
cmd: "$(location stats-log-api-gen) --java $(out) --module telephony" +
|
||||
" --javaPackage com.android.internal.telephony --javaClass TelephonyStatsLog",
|
||||
out: ["com/android/internal/telephony/TelephonyStatsLog.java"],
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package android.telephony;
|
||||
|
||||
import static com.android.internal.telephony.TelephonyStatsLog.TELEPHONY_ANOMALY_DETECTED;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.RequiresPermission;
|
||||
import android.content.Context;
|
||||
@@ -24,6 +26,7 @@ import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.os.ParcelUuid;
|
||||
|
||||
import com.android.internal.telephony.TelephonyStatsLog;
|
||||
import com.android.internal.util.IndentingPrintWriter;
|
||||
import com.android.telephony.Rlog;
|
||||
|
||||
@@ -83,6 +86,12 @@ public final class AnomalyReporter {
|
||||
return;
|
||||
}
|
||||
|
||||
TelephonyStatsLog.write(
|
||||
TELEPHONY_ANOMALY_DETECTED,
|
||||
0, // TODO: carrier id needs to be populated
|
||||
eventId.getLeastSignificantBits(),
|
||||
eventId.getMostSignificantBits());
|
||||
|
||||
// If this event has already occurred, skip sending intents for it; regardless log its
|
||||
// invocation here.
|
||||
Integer count = sEvents.containsKey(eventId) ? sEvents.get(eventId) + 1 : 1;
|
||||
|
||||
Reference in New Issue
Block a user