Merge "ChangeReporter: disable eager reporting" into udc-dev

This commit is contained in:
Tim Murray
2023-03-03 01:31:38 +00:00
committed by Android (Google) Code Review

View File

@@ -42,6 +42,7 @@ import java.util.Set;
public final class ChangeReporter { public final class ChangeReporter {
private static final String TAG = "CompatibilityChangeReporter"; private static final String TAG = "CompatibilityChangeReporter";
private int mSource; private int mSource;
private static final boolean sShouldReport = false;
private static final class ChangeReport { private static final class ChangeReport {
long mChangeId; long mChangeId;
@@ -89,6 +90,7 @@ public final class ChangeReporter {
* @param state of the reported change - enabled/disabled/only logged * @param state of the reported change - enabled/disabled/only logged
*/ */
public void reportChange(int uid, long changeId, int state) { public void reportChange(int uid, long changeId, int state) {
if (sShouldReport) {
if (shouldWriteToStatsLog(uid, changeId, state)) { if (shouldWriteToStatsLog(uid, changeId, state)) {
FrameworkStatsLog.write(FrameworkStatsLog.APP_COMPATIBILITY_CHANGE_REPORTED, uid, FrameworkStatsLog.write(FrameworkStatsLog.APP_COMPATIBILITY_CHANGE_REPORTED, uid,
changeId, state, mSource); changeId, state, mSource);
@@ -98,6 +100,7 @@ public final class ChangeReporter {
} }
markAsReported(uid, new ChangeReport(changeId, state)); markAsReported(uid, new ChangeReport(changeId, state));
} }
}
/** /**
* Start logging all the time to logcat. * Start logging all the time to logcat.