Bug 1380854 - Drop an event when User signs in. r?grisha
MozReview-Commit-ID: EDrw2LAr4BO
--- a/mobile/android/base/java/org/mozilla/gecko/AccountsHelper.java
+++ b/mobile/android/base/java/org/mozilla/gecko/AccountsHelper.java
@@ -17,16 +17,17 @@ import android.util.Log;
import org.json.JSONException;
import org.mozilla.gecko.background.fxa.FxAccountUtils;
import org.mozilla.gecko.fxa.FirefoxAccounts;
import org.mozilla.gecko.fxa.FxAccountConstants;
import org.mozilla.gecko.fxa.authenticator.AndroidFxAccount;
import org.mozilla.gecko.fxa.login.Engaged;
import org.mozilla.gecko.fxa.login.State;
+import org.mozilla.gecko.mma.MmaDelegate;
import org.mozilla.gecko.restrictions.Restrictable;
import org.mozilla.gecko.restrictions.Restrictions;
import org.mozilla.gecko.sync.SyncConfiguration;
import org.mozilla.gecko.sync.Utils;
import org.mozilla.gecko.util.BundleEventListener;
import org.mozilla.gecko.util.EventCallback;
import org.mozilla.gecko.util.GeckoBundle;
import org.mozilla.gecko.util.ThreadUtils;
@@ -151,16 +152,17 @@ public class AccountsHelper implements B
if (callback != null) {
callback.sendSuccess(fxAccount != null);
}
} else if ("Accounts:UpdateFirefoxAccountFromJSON".equals(event)) {
// We might be significantly changing state of the account; let's ensure our in-memory
// accounts cache is empty so that there are no undesired side-effects.
AndroidFxAccount.invalidateCaches();
+ MmaDelegate.track(MmaDelegate.USER_SIGNED_IN_TO_FXA);
final Account account = FirefoxAccounts.getFirefoxAccount(mContext);
if (account == null) {
if (callback != null) {
callback.sendError("Could not update Firefox Account since none exists");
}
return;
}
--- a/mobile/android/base/java/org/mozilla/gecko/mma/MmaDelegate.java
+++ b/mobile/android/base/java/org/mozilla/gecko/mma/MmaDelegate.java
@@ -38,16 +38,17 @@ public class MmaDelegate {
public static final String CLEARED_PRIVATE_DATA = "E_Cleared_Private_Data";
public static final String SAVED_BOOKMARK = "E_Saved_Bookmark";
public static final String OPENED_BOOKMARK = "E_Opened_Bookmark";
public static final String INTERACT_WITH_SEARCH_URL_AREA = "E_Interact_With_Search_URL_Area";
public static final String SCREENSHOT = "E_Screenshot";
public static final String SAVED_LOGIN_AND_PASSWORD = "E_Saved_Login_And_Password";
public static final String LAUNCH_BUT_NOT_DEFAULT_BROWSER = "E_Launch_But_Not_Default_Browser";
public static final String NEW_TAB = "E_Opened_New_Tab";
+ public static final String USER_SIGNED_IN_TO_FXA = "E_User_Signed_In_To_FxA";
public static final String USER_ATT_FOCUS_INSTALLED = "Focus Installed";
public static final String USER_ATT_KLAR_INSTALLED = "Klar Installed";
public static final String USER_ATT_DEFAULT_BROWSER = "Default Browser";
public static final String USER_ATT_SIGNED_IN = "Signed In Sync";