From 84dda853d3ad5769c928ed95f77bcb694fb0d622 Mon Sep 17 00:00:00 2001 From: Matt Casey Date: Wed, 22 Feb 2023 21:20:25 +0000 Subject: Log number of custom actions and presence of modify share action Also remove an unused logging parameter. Clarify nullability of custom actions list (should migrate this to kotlin sometime). Bug: 265504112 Test: atest ChooserActivityLoggerTest Change-Id: If3f224ef16755a9a3a2c625d63e2fc35888fa37a --- .../android/intentresolver/ChooserActivityLoggerTest.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'java/tests') diff --git a/java/tests/src/com/android/intentresolver/ChooserActivityLoggerTest.java b/java/tests/src/com/android/intentresolver/ChooserActivityLoggerTest.java index d8868fc1..7d1b2488 100644 --- a/java/tests/src/com/android/intentresolver/ChooserActivityLoggerTest.java +++ b/java/tests/src/com/android/intentresolver/ChooserActivityLoggerTest.java @@ -112,7 +112,6 @@ public final class ChooserActivityLoggerTest { @Test public void testLogShareStarted() { - final int eventId = -1; // Passed-in eventId is unused. TODO: remove from method signature. final String packageName = "com.test.foo"; final String mimeType = "text/plain"; final int appProvidedDirectTargets = 123; @@ -120,16 +119,19 @@ public final class ChooserActivityLoggerTest { final boolean workProfile = true; final int previewType = ChooserContentPreviewUi.CONTENT_PREVIEW_FILE; final String intentAction = Intent.ACTION_SENDTO; + final int numCustomActions = 3; + final boolean modifyShareProvided = true; mChooserLogger.logShareStarted( - eventId, packageName, mimeType, appProvidedDirectTargets, appProvidedAppTargets, workProfile, previewType, - intentAction); + intentAction, + numCustomActions, + modifyShareProvided); verify(mFrameworkLog).write( eq(FrameworkStatsLog.SHARESHEET_STARTED), @@ -142,8 +144,8 @@ public final class ChooserActivityLoggerTest { eq(workProfile), eq(FrameworkStatsLog.SHARESHEET_STARTED__PREVIEW_TYPE__CONTENT_PREVIEW_FILE), eq(FrameworkStatsLog.SHARESHEET_STARTED__INTENT_TYPE__INTENT_ACTION_SENDTO), - /* custom actions provided */ eq(0), - /* reselection action provided */ eq(false)); + /* custom actions provided */ eq(numCustomActions), + /* reselection action provided */ eq(modifyShareProvided)); } @Test -- cgit v1.2.3-59-g8ed1b