summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Susi Kharraz-Post <susikp@google.com> 2019-04-23 15:07:10 -0400
committer Susi Kharraz-Post <susikp@google.com> 2019-04-23 15:07:10 -0400
commit4bcca528e3af74e36ebebda0b8d1c847dc7f97c0 (patch)
treeb6e1522ef7ff3b090fd14725d67b26f22f019d4b
parent25b06f04d4d79b9fc8f9a74d54b27bdccabd88bb (diff)
Restructure logging for selection of share targets
After discussions with Matt restructuring the logging so each category corresponds to one of the fields in the new sharesheet and add a field that indicates the number of caller supplied share targets. Also fixing a bug that resulted in double logging. Bug: 131170860 Test: Manual testing with adb logcat Change-Id: I75e69f7dec2d6634fca7d55321298d9d8acf4382
-rw-r--r--core/java/com/android/internal/app/ChooserActivity.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java
index be66de22cdcf..f0c64134c6af 100644
--- a/core/java/com/android/internal/app/ChooserActivity.java
+++ b/core/java/com/android/internal/app/ChooserActivity.java
@@ -1018,12 +1018,9 @@ public class ChooserActivity extends ResolverActivity {
int cat = 0;
int value = which;
int directTargetAlsoRanked = -1;
+ int numCallerProvided = 0;
HashedStringCache.HashResult directTargetHashed = null;
switch (mChooserListAdapter.getPositionTargetType(which)) {
- case ChooserListAdapter.TARGET_CALLER:
- cat = MetricsEvent.ACTION_ACTIVITY_CHOOSER_PICKED_APP_TARGET;
- value -= mChooserListAdapter.getSelectableServiceTargetCount();
- break;
case ChooserListAdapter.TARGET_SERVICE:
cat = MetricsEvent.ACTION_ACTIVITY_CHOOSER_PICKED_SERVICE_TARGET;
// Log the package name + target name to answer the question if most users
@@ -1039,13 +1036,14 @@ public class ChooserActivity extends ResolverActivity {
directTargetAlsoRanked = getRankedPosition((SelectableTargetInfo) targetInfo);
if (mCallerChooserTargets != null) {
- value -= mCallerChooserTargets.length;
+ numCallerProvided = mCallerChooserTargets.length;
}
break;
+ case ChooserListAdapter.TARGET_CALLER:
case ChooserListAdapter.TARGET_STANDARD:
- cat = MetricsEvent.ACTION_ACTIVITY_CHOOSER_PICKED_STANDARD_TARGET;
- value -= mChooserListAdapter.getCallerTargetCount()
- + mChooserListAdapter.getSelectableServiceTargetCount();
+ cat = MetricsEvent.ACTION_ACTIVITY_CHOOSER_PICKED_APP_TARGET;
+ value -= mChooserListAdapter.getSelectableServiceTargetCount();
+ numCallerProvided = mChooserListAdapter.getCallerTargetCount();
break;
case ChooserListAdapter.TARGET_STANDARD_AZ:
// A-Z targets are unranked standard targets; we use -1 to mark that they
@@ -1066,8 +1064,9 @@ public class ChooserActivity extends ResolverActivity {
targetLogMaker.addTaggedData(MetricsEvent.FIELD_RANKED_POSITION,
directTargetAlsoRanked);
}
+ targetLogMaker.addTaggedData(MetricsEvent.FIELD_IS_CATEGORY_USED,
+ numCallerProvided);
getMetricsLogger().write(targetLogMaker);
- MetricsLogger.action(this, cat, value);
}
if (mIsSuccessfullySelected) {