summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2020-05-18 01:31:21 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-05-18 01:31:21 +0000
commitf59ffe06b63313dfffbede0e2e3df6a10e70c26d (patch)
treef0b48f7feefa3a91634bff9b06c1434cf457c78e
parented218c11a70e60806088feb3241dfe8284b7b370 (diff)
parente9f930329cd71c8b9b1ae8e65399387ec84c8b8b (diff)
Merge "Make DocsUI only log to device policy logger on R+" into rvc-dev
-rw-r--r--src/com/android/documentsui/Metrics.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/documentsui/Metrics.java b/src/com/android/documentsui/Metrics.java
index 303add371..9d20fce1e 100644
--- a/src/com/android/documentsui/Metrics.java
+++ b/src/com/android/documentsui/Metrics.java
@@ -45,6 +45,7 @@ import com.android.documentsui.picker.PickResult;
import com.android.documentsui.roots.ProvidersAccess;
import com.android.documentsui.services.FileOperationService;
import com.android.documentsui.services.FileOperationService.OpType;
+import com.android.documentsui.util.VersionUtils;
import java.io.FileNotFoundException;
import java.util.List;
@@ -645,11 +646,15 @@ public final class Metrics {
}
/**
- * The implementation is copied from StatsLogInternal for the DEVICE_POLICY_EVENT.
+ * The implementation is copied from StatsLogInternal for the DEVICE_POLICY_EVENT. This is a
+ * no-op pre-R.
*/
private static class DevicePolicyEventLogger {
public static void write(@DevicePolicyMetricConsts.EventId int eventId,
boolean booleanValue) {
+ if (!VersionUtils.isAtLeastR()) {
+ return;
+ }
final StatsEvent.Builder builder = StatsEvent.newBuilder();
builder.setAtomId(DevicePolicyMetricConsts.ATOM_DEVICE_POLICY_EVENT);
builder.writeInt(eventId); // eventId