mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1057613 - Telemetry for search widget buttons. r=margaret
This commit is contained in:
parent
fccbef4359
commit
2c04333cc7
@ -168,6 +168,9 @@ public interface TelemetryContract {
|
||||
// Note: Only used in JavaScript for now, but here for completeness.
|
||||
TOAST("toast"),
|
||||
|
||||
// Action triggerred by pressing a SearchWidget button
|
||||
WIDGET("widget"),
|
||||
|
||||
// VALUES BELOW THIS LINE ARE EXCLUSIVE TO TESTING.
|
||||
_TEST1("_test_method_1"),
|
||||
_TEST2("_test_method_2"),
|
||||
|
@ -6,6 +6,8 @@
|
||||
package org.mozilla.search;
|
||||
|
||||
import org.mozilla.gecko.AppConstants;
|
||||
import org.mozilla.gecko.Telemetry;
|
||||
import org.mozilla.gecko.TelemetryContract;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.PendingIntent;
|
||||
@ -67,16 +69,22 @@ public class SearchWidget extends AppWidgetProvider {
|
||||
AppConstants.ANDROID_PACKAGE_NAME,
|
||||
AppConstants.BROWSER_INTENT_CLASS_NAME,
|
||||
intent);
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.LAUNCH,
|
||||
TelemetryContract.Method.WIDGET, "browser");
|
||||
} else if (intent.getAction().equals(ACTION_LAUNCH_NEW_TAB)) {
|
||||
redirect = buildRedirectIntent(Intent.ACTION_VIEW,
|
||||
AppConstants.ANDROID_PACKAGE_NAME,
|
||||
AppConstants.BROWSER_INTENT_CLASS_NAME,
|
||||
intent);
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.LAUNCH,
|
||||
TelemetryContract.Method.WIDGET, "new-tab");
|
||||
} else if (intent.getAction().equals(ACTION_LAUNCH_SEARCH)) {
|
||||
redirect = buildRedirectIntent(Intent.ACTION_VIEW,
|
||||
AppConstants.SEARCH_PACKAGE_NAME,
|
||||
AppConstants.SEARCH_INTENT_CLASS_NAME,
|
||||
intent);
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.LAUNCH,
|
||||
TelemetryContract.Method.WIDGET, "search");
|
||||
} else {
|
||||
redirect = null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user