Bug 1351555 - PWA Collect information on the number of progressive web apps added to homescreen. r?sebastian,daleharvey
MozReview-Commit-ID: FYZUtNut0Hv
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -2052,16 +2052,18 @@ public abstract class GeckoApp
}
public void createAppShortcut(final String aTitle, final String aURI, final String manifestPath, final Bitmap aIcon) {
Intent shortcutIntent = new Intent();
shortcutIntent.setAction(GeckoApp.ACTION_WEBAPP);
shortcutIntent.setData(Uri.parse(aURI));
shortcutIntent.putExtra("MANIFEST_PATH", manifestPath);
shortcutIntent.setClassName(AppConstants.ANDROID_PACKAGE_NAME, LauncherActivity.class.getName());
+ Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU,
+ "pwa_add_to_launcher");
createHomescreenIcon(shortcutIntent, aTitle, aURI, aIcon);
}
public void createHomescreenIcon(final Intent shortcutIntent, final String aTitle,
final String aURI, final Bitmap aIcon) {
Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, getLauncherIcon(aIcon, GeckoAppShell.getPreferredIconSize()));