Bug 1351556 - Collect information on the number of users using PWA. r?sebastian,daleharvey draft
authorNevin Chen <cnevinchen@gmail.com>
Thu, 06 Apr 2017 17:29:53 +0800
changeset 556696 e7bf43a0d9f16eac0e90d937b862a6b2b1f39843
parent 556622 ec8d1d3db50c85037e8077c32c8403570a5df493
child 622959 54b39d544fae191743ee5c8b733b49a09a2b5aff
push id52622
push userbmo:cnevinchen@gmail.com
push dateThu, 06 Apr 2017 09:30:56 +0000
reviewerssebastian, daleharvey
bugs1351556
milestone55.0a1
Bug 1351556 - Collect information on the number of users using PWA. r?sebastian,daleharvey MozReview-Commit-ID: CyVFQUtd5Aw
mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
+++ b/mobile/android/base/java/org/mozilla/gecko/webapps/WebAppActivity.java
@@ -26,16 +26,18 @@ import android.widget.TextView;
 import org.json.JSONObject;
 import org.json.JSONException;
 
 import org.mozilla.gecko.AppConstants;
 import org.mozilla.gecko.EventDispatcher;
 import org.mozilla.gecko.GeckoApp;
 import org.mozilla.gecko.GeckoAppShell;
 import org.mozilla.gecko.GeckoProfile;
+import org.mozilla.gecko.Telemetry;
+import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.icons.decoders.FaviconDecoder;
 import org.mozilla.gecko.mozglue.SafeIntent;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.Tab;
 import org.mozilla.gecko.Tabs;
 import org.mozilla.gecko.util.ColorUtil;
 import org.mozilla.gecko.util.EventCallback;
 import org.mozilla.gecko.util.FileUtils;
@@ -50,16 +52,18 @@ public class WebAppActivity extends Geck
 
     private TextView mUrlView;
     private String mManifestPath;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
+        Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.INTENT, "webapp");
+
         if (savedInstanceState != null) {
             mManifestPath = savedInstanceState.getString(WebAppActivity.MANIFEST_PATH, null);
         } else {
             mManifestPath = getIntent().getStringExtra(WebAppActivity.MANIFEST_PATH);
         }
         loadManifest(mManifestPath);
 
         final Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar);
@@ -149,16 +153,17 @@ public class WebAppActivity extends Geck
 
         final SafeIntent intent = new SafeIntent(externalIntent);
         final String launchUrl = intent.getDataString();
         final String currentUrl = Tabs.getInstance().getSelectedTab().getURL();
         final boolean isSameDomain = Uri.parse(currentUrl).getHost()
             .equals(Uri.parse(launchUrl).getHost());
 
         if (!isSameDomain) {
+            Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.INTENT, "webapp");
             mManifestPath = externalIntent.getStringExtra(WebAppActivity.MANIFEST_PATH);
             loadManifest(mManifestPath);
             Tabs.getInstance().loadUrl(launchUrl);
         }
     }
 
     private void loadManifest(String manifestPath) {
         if (manifestPath == null) {