Commit 21a14c8b authored by Michael Thiessen's avatar Michael Thiessen Committed by Commit Bot

Don't include Chrome-originating intents in ExternalApp launch metrics

When Chrome is the app firing the intent, don't record it as an external
app launch.

I also fix the case where we've added Chrome's trusted intent extras but
not added Chrome's app id, which was previously counted in the UNKNOWN
bucket. As far as I can tell though, only the search widget does this.

Bug: b/167573777
Change-Id: I3be6321fa1c35f8860577a9d9fb771a40ca8ba19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2398193Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805353}
parent 0a8e1351
......@@ -353,6 +353,8 @@ public class IntentHandler {
* @return ExternalAppId representing the app.
*/
public static @ExternalAppId int determineExternalIntentSource(Intent intent) {
if (wasIntentSenderChrome(intent)) return ExternalAppId.CHROME;
String appId = IntentUtils.safeGetStringExtra(intent, Browser.EXTRA_APPLICATION_ID);
@ExternalAppId
int externalId = ExternalAppId.OTHER;
......@@ -420,6 +422,9 @@ public class IntentHandler {
private void recordExternalIntentSourceUMA(Intent intent) {
@ExternalAppId
int externalId = determineExternalIntentSource(intent);
// Don't record external app page loads for intents we sent.
if (externalId == ExternalAppId.CHROME) return;
RecordHistogram.recordEnumeratedHistogram(
"MobileIntent.PageLoadDueToExternalApp", externalId, ExternalAppId.NUM_ENTRIES);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment