Backed out changeset 91bc05242c6f (bug 1534451) for causing AdvertisingUtil.java build bustages CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Tue, 14 May 2019 02:46:28 +0300
changeset 473681 d6e21ffd8ecceee564afa0c7c8b1bcf61fbd6aff
parent 473680 91bc05242c6f02a5d30c71557693129303e7067e
child 473682 c23eb772cf2d59a8d7954340a010768a757e71f9
push id36009
push userapavel@mozilla.com
push dateTue, 14 May 2019 04:07:34 +0000
treeherdermozilla-central@96563508f9fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1534451
milestone68.0a1
backs out91bc05242c6f02a5d30c71557693129303e7067e
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 91bc05242c6f (bug 1534451) for causing AdvertisingUtil.java build bustages CLOSED TREE
mobile/android/app/build.gradle
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
mobile/android/base/java/org/mozilla/gecko/advertising/AdvertisingUtil.java
mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryActivationPingDelegate.java
mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryCorePingDelegate.java
mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryDispatcher.java
mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryUploadService.java
mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetryActivationPingBuilder.java
mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetryPingBuilder.java
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -172,17 +172,16 @@ android {
         test {
             java {
                 // Bug 1229149 tracks pushing this into a :services Gradle project.
                 srcDir "${topsrcdir}/mobile/android/services/src/test/java"
 
                 if (!mozconfig.substs.MOZ_ANDROID_GCM) {
                     exclude 'org/mozilla/gecko/gcm/**/*.java'
                     exclude 'org/mozilla/gecko/push/**/*.java'
-                    exclude 'org/mozilla/gecko/advertising/**'
                 }
             }
             resources {
                 // Bug 1229149 tracks pushing this into a :services Gradle project.
                 srcDir "${topsrcdir}/mobile/android/services/src/test/resources"
             }
         }
 
@@ -240,18 +239,16 @@ dependencies {
         implementation "com.google.android.gms:play-services-ads-identifier:$google_play_services_version"
         implementation "com.google.android.gms:play-services-basement:$google_play_services_version"
     }
 
     if (mozconfig.substs.MOZ_ANDROID_GCM) {
         implementation "com.google.android.gms:play-services-basement:$google_play_services_version"
         implementation "com.google.android.gms:play-services-base:$google_play_services_version"
         implementation "com.google.android.gms:play-services-gcm:$google_play_services_version"
-        implementation "com.google.android.gms:play-services-ads-identifier:$google_play_services_version"
-        implementation "org.mindrot:jbcrypt:0.4"
     }
 
     if (mozconfig.substs.MOZ_ANDROID_GOOGLE_PLAY_SERVICES) {
         implementation "com.google.android.gms:play-services-fido:$google_play_services_fido_version"
     }
 
     // Include LeakCanary in local builds, but not in official builds.
     if (mozconfig.substs.MOZILLA_OFFICIAL) {
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -133,17 +133,16 @@ import org.mozilla.gecko.tabqueue.TabQue
 import org.mozilla.gecko.tabs.TabHistoryController;
 import org.mozilla.gecko.tabs.TabHistoryController.OnShowTabHistory;
 import org.mozilla.gecko.tabs.TabHistoryFragment;
 import org.mozilla.gecko.tabs.TabHistoryPage;
 import org.mozilla.gecko.tabs.TabsPanel;
 import org.mozilla.gecko.telemetry.TelemetryCorePingDelegate;
 import org.mozilla.gecko.telemetry.TelemetryUploadService;
 import org.mozilla.gecko.telemetry.measurements.SearchCountMeasurements;
-import org.mozilla.gecko.telemetry.TelemetryActivationPingDelegate;
 import org.mozilla.gecko.toolbar.AutocompleteHandler;
 import org.mozilla.gecko.toolbar.BrowserToolbar;
 import org.mozilla.gecko.toolbar.BrowserToolbar.CommitEventSource;
 import org.mozilla.gecko.toolbar.BrowserToolbar.TabEditingState;
 import org.mozilla.gecko.toolbar.PwaConfirm;
 import org.mozilla.gecko.trackingprotection.TrackingProtectionPrompt;
 import org.mozilla.gecko.updater.PostUpdateHandler;
 import org.mozilla.gecko.updater.UpdateServiceHelper;
@@ -314,25 +313,23 @@ public class BrowserApp extends GeckoApp
     // (starting the animation), the HomePager is hidden, and the HomePager animation completes,
     // both the web content and the HomePager will be hidden. This flag is used to prevent the
     // race by determining if the web content should be hidden at the animation's end.
     private boolean mHideWebContentOnAnimationEnd;
 
     private final DynamicToolbar mDynamicToolbar = new DynamicToolbar();
 
     private final TelemetryCorePingDelegate mTelemetryCorePingDelegate = new TelemetryCorePingDelegate();
-    private final TelemetryActivationPingDelegate mTelemetryActivationPingDelegate = new TelemetryActivationPingDelegate();
 
     private final List<BrowserAppDelegate> delegates = Collections.unmodifiableList(Arrays.asList(
             new ScreenshotDelegate(),
             new BookmarkStateChangeDelegate(),
             new ReaderViewBookmarkPromotion(),
             new PostUpdateHandler(),
             mTelemetryCorePingDelegate,
-            mTelemetryActivationPingDelegate,
             new OfflineTabStatusDelegate(),
             new AdjustBrowserAppDelegate(mTelemetryCorePingDelegate)
     ));
 
     @NonNull
     private SearchEngineManager mSearchEngineManager; // Contains reference to Context - DO NOT LEAK!
     private OnboardingHelper mOnboardingHelper;       // Contains reference to Context - DO NOT LEAK!
 
deleted file mode 100644
--- a/mobile/android/base/java/org/mozilla/gecko/advertising/AdvertisingUtil.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.mozilla.gecko.advertising;
-
-import android.content.Context;
-
-import com.google.android.gms.ads.identifier.AdvertisingIdClient;
-import com.leanplum.internal.Log;
-
-import org.mindrot.jbcrypt.BCrypt;
-import org.mozilla.gecko.annotation.ReflectionTarget;
-
-@ReflectionTarget
-public class AdvertisingUtil {
-    /* Use the same SALT for all BCrypt hashings. We want the SALT to be stable for all Fennec users but it should differ from the one from Fenix.
-     * Generated using Bcrypt.gensalt(). */
-    private static final String BCRYPT_SALT = "$2a$10$ZfglUfcbmTyaBbAQ7SL9OO";
-
-    /**
-     * Retrieves the advertising ID hashed with BCrypt. Requires Google Play Services. Note: This method must not run on
-     * the main thread.
-     */
-    @ReflectionTarget
-    public static String getAdvertisingId(Context caller) {
-        try {
-            AdvertisingIdClient.Info info = AdvertisingIdClient.getAdvertisingIdInfo(caller);
-            String advertisingId = info.getId();
-            return advertisingId != null ? BCrypt.hashpw(advertisingId, BCRYPT_SALT) : null;
-        } catch (Throwable t) {
-            Log.e("Error retrieving advertising ID.", t);
-        }
-        return null;
-    }
-}
deleted file mode 100644
--- a/mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryActivationPingDelegate.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package org.mozilla.gecko.telemetry;
-
-import android.content.Context;
-import android.os.Bundle;
-import android.support.annotation.WorkerThread;
-import android.util.Log;
-
-import org.mozilla.gecko.AppConstants;
-import org.mozilla.gecko.BrowserApp;
-import org.mozilla.gecko.GeckoProfile;
-import org.mozilla.gecko.GeckoThread;
-import org.mozilla.gecko.delegates.BrowserAppDelegate;
-import org.mozilla.gecko.telemetry.pingbuilders.TelemetryActivationPingBuilder;
-import org.mozilla.gecko.util.StringUtils;
-import org.mozilla.gecko.util.ThreadUtils;
-
-import java.io.IOException;
-import java.lang.reflect.Method;
-
-/**
- * An activity-lifecycle delegate for uploading the activation ping.
- */
-public class TelemetryActivationPingDelegate extends BrowserAppDelegate {
-    private static final String LOGTAG = StringUtils.safeSubstring(
-            "Gecko" + TelemetryActivationPingDelegate.class.getSimpleName(), 0, 23);
-
-    private TelemetryDispatcher telemetryDispatcher; // lazy
-
-
-    @Override
-    public void onCreate(BrowserApp browserApp, Bundle savedInstanceState) {
-        super.onCreate(browserApp, savedInstanceState);
-        uploadActivationPing(browserApp);
-    }
-
-    private void uploadActivationPing(final BrowserApp activity) {
-        if (!AppConstants.MOZ_ANDROID_GCM) {
-            return;
-        }
-
-        if(TelemetryActivationPingBuilder.activationPingAlreadySent(activity)) {
-            return;
-        }
-
-        ThreadUtils.postToBackgroundThread(() -> {
-            if (activity == null) {
-                return;
-            }
-
-            if (!TelemetryUploadService.isUploadEnabledByAppConfig(activity)) {
-                Log.d(LOGTAG, "Activation ping upload disabled by app config. Returning.");
-                return;
-            }
-
-            String identifier = null;
-
-            try {
-                final Class<?> clazz = Class.forName("org.mozilla.gecko.advertising.AdvertisingUtil");
-                final Method getAdvertisingId = clazz.getMethod("getAdvertisingId", Context.class);
-                identifier = (String) getAdvertisingId.invoke(null, activity);
-            } catch (Exception e) {
-                Log.w(LOGTAG, "Unable to get identifier: " + e);
-            }
-
-            final GeckoProfile profile = GeckoThread.getActiveProfile();
-            String clientID = null;
-            try {
-                clientID = profile.getClientId();
-            } catch (final IOException e) {
-                Log.w(LOGTAG, "Unable to get client ID: " + e);
-                if (identifier == null) {
-                    //Activation ping is mandatory to be sent with either the identifier or the clientID.
-                    Log.d(LOGTAG, "Activation ping failed to send - both identifier and clientID were unable to be retrieved.");
-                    return;
-                }
-            }
-
-            final TelemetryActivationPingBuilder pingBuilder = new TelemetryActivationPingBuilder(activity);
-            if (identifier != null) {
-                pingBuilder.setIdentifier(identifier);
-            } else {
-                pingBuilder.setClientID(clientID);
-            }
-
-            getTelemetryDispatcher().queuePingForUpload(activity, pingBuilder);
-        });
-    }
-
-    @WorkerThread // via constructor
-    private TelemetryDispatcher getTelemetryDispatcher() {
-        if (telemetryDispatcher == null) {
-            final GeckoProfile profile = GeckoThread.getActiveProfile();
-            final String profilePath = profile.getDir().getAbsolutePath();
-            final String profileName = profile.getName();
-            telemetryDispatcher = new TelemetryDispatcher(profilePath, profileName);
-        }
-        return telemetryDispatcher;
-    }
-}
--- a/mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryCorePingDelegate.java
+++ b/mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryCorePingDelegate.java
@@ -16,21 +16,21 @@ import android.view.accessibility.Access
 import org.mozilla.gecko.BrowserApp;
 import org.mozilla.gecko.GeckoApp;
 import org.mozilla.gecko.GeckoProfile;
 import org.mozilla.gecko.GeckoSharedPrefs;
 import org.mozilla.gecko.GeckoThread;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.adjust.AttributionHelperListener;
+import org.mozilla.gecko.telemetry.measurements.CampaignIdMeasurements;
 import org.mozilla.gecko.delegates.BrowserAppDelegateWithReference;
 import org.mozilla.gecko.distribution.DistributionStoreCallback;
 import org.mozilla.gecko.search.SearchEngineManager;
 import org.mozilla.gecko.sync.ExtendedJSONObject;
-import org.mozilla.gecko.telemetry.measurements.CampaignIdMeasurements;
 import org.mozilla.gecko.telemetry.measurements.SearchCountMeasurements;
 import org.mozilla.gecko.telemetry.measurements.SessionMeasurements;
 import org.mozilla.gecko.telemetry.pingbuilders.TelemetryCorePingBuilder;
 import org.mozilla.gecko.util.StringUtils;
 import org.mozilla.gecko.util.ThreadUtils;
 
 import java.io.IOException;
 import java.util.List;
@@ -134,53 +134,57 @@ public class TelemetryCorePingDelegate e
         if (getBrowserApp() == null) {
             return;
         }
 
         // The containing method can be called from onStart: queue this work so that
         // the first launch of the activity doesn't trigger profile init too early.
         //
         // Additionally, getAndIncrementSequenceNumber must be called from a worker thread.
-        ThreadUtils.postToBackgroundThread(() -> {
-            final BrowserApp activity = getBrowserApp();
-            if (activity == null) {
-                return;
-            }
+        ThreadUtils.postToBackgroundThread(new Runnable() {
+            @WorkerThread
+            @Override
+            public void run() {
+                final BrowserApp activity = getBrowserApp();
+                if (activity == null) {
+                    return;
+                }
 
-            final GeckoProfile profile = GeckoThread.getActiveProfile();
-            if (!TelemetryUploadService.isUploadEnabledByProfileConfig(activity, profile)) {
-                Log.d(LOGTAG, "Core ping upload disabled by profile config. Returning.");
-                return;
-            }
+                final GeckoProfile profile = GeckoThread.getActiveProfile();
+                if (!TelemetryUploadService.isUploadEnabledByProfileConfig(activity, profile)) {
+                    Log.d(LOGTAG, "Core ping upload disabled by profile config. Returning.");
+                    return;
+                }
 
-            final String clientID;
-            final boolean hadCanaryClientId;
-            try {
-                clientID = profile.getClientId();
-                hadCanaryClientId = profile.getIfHadCanaryClientId();
-            } catch (final IOException e) {
-                Log.w(LOGTAG, "Unable to get client ID properties to generate core ping: " + e);
-                return;
-            }
+                final String clientID;
+                final boolean hadCanaryClientId;
+                try {
+                    clientID = profile.getClientId();
+                    hadCanaryClientId = profile.getIfHadCanaryClientId();
+                } catch (final IOException e) {
+                    Log.w(LOGTAG, "Unable to get client ID properties to generate core ping: " + e);
+                    return;
+                }
 
-            // Each profile can have different telemetry data so we intentionally grab the shared prefs for the profile.
-            final SharedPreferences sharedPrefs = getSharedPreferences(activity);
-            final SessionMeasurements.SessionMeasurementsContainer sessionMeasurementsContainer =
-                    sessionMeasurements.getAndResetSessionMeasurements(activity);
-            final TelemetryCorePingBuilder pingBuilder = new TelemetryCorePingBuilder(activity)
-                    .setClientID(clientID)
-                    .setHadCanaryClientId(hadCanaryClientId)
-                    .setDefaultSearchEngine(TelemetryCorePingBuilder.getEngineIdentifier(engine))
-                    .setProfileCreationDate(TelemetryCorePingBuilder.getProfileCreationDate(activity, profile))
-                    .setSequenceNumber(TelemetryCorePingBuilder.getAndIncrementSequenceNumber(sharedPrefs))
-                    .setSessionCount(sessionMeasurementsContainer.sessionCount)
-                    .setSessionDuration(sessionMeasurementsContainer.elapsedSeconds);
-            maybeSetOptionalMeasurements(activity, sharedPrefs, pingBuilder);
+                // Each profile can have different telemetry data so we intentionally grab the shared prefs for the profile.
+                final SharedPreferences sharedPrefs = getSharedPreferences(activity);
+                final SessionMeasurements.SessionMeasurementsContainer sessionMeasurementsContainer =
+                        sessionMeasurements.getAndResetSessionMeasurements(activity);
+                final TelemetryCorePingBuilder pingBuilder = new TelemetryCorePingBuilder(activity)
+                        .setClientID(clientID)
+                        .setHadCanaryClientId(hadCanaryClientId)
+                        .setDefaultSearchEngine(TelemetryCorePingBuilder.getEngineIdentifier(engine))
+                        .setProfileCreationDate(TelemetryCorePingBuilder.getProfileCreationDate(activity, profile))
+                        .setSequenceNumber(TelemetryCorePingBuilder.getAndIncrementSequenceNumber(sharedPrefs))
+                        .setSessionCount(sessionMeasurementsContainer.sessionCount)
+                        .setSessionDuration(sessionMeasurementsContainer.elapsedSeconds);
+                maybeSetOptionalMeasurements(activity, sharedPrefs, pingBuilder);
 
-            getTelemetryDispatcher(activity).queuePingForUpload(activity, pingBuilder);
+                getTelemetryDispatcher(activity).queuePingForUpload(activity, pingBuilder);
+            }
         });
     }
 
     private void maybeSetOptionalMeasurements(final Context context, final SharedPreferences sharedPrefs,
                                               final TelemetryCorePingBuilder pingBuilder) {
         final String distributionId = sharedPrefs.getString(DistributionStoreCallback.PREF_DISTRIBUTION_ID, null);
         if (distributionId != null) {
             pingBuilder.setOptDistributionID(distributionId);
--- a/mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryDispatcher.java
+++ b/mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryDispatcher.java
@@ -4,18 +4,16 @@
  * file, you can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 package org.mozilla.gecko.telemetry;
 
 import android.content.Context;
 import android.support.annotation.WorkerThread;
 import android.util.Log;
-
-import org.mozilla.gecko.telemetry.pingbuilders.TelemetryActivationPingBuilder;
 import org.mozilla.gecko.telemetry.pingbuilders.TelemetryCorePingBuilder;
 import org.mozilla.gecko.telemetry.pingbuilders.TelemetryCrashPingBuilder;
 import org.mozilla.gecko.telemetry.schedulers.TelemetryUploadScheduler;
 import org.mozilla.gecko.telemetry.schedulers.TelemetryUploadAllPingsImmediatelyScheduler;
 import org.mozilla.gecko.telemetry.stores.TelemetryJSONFilePingStore;
 import org.mozilla.gecko.telemetry.stores.TelemetryPingStore;
 import org.mozilla.gecko.util.ThreadUtils;
 
@@ -88,24 +86,16 @@ public class TelemetryDispatcher {
      * Queues the given ping for upload and potentially schedules upload. This method can be called from any thread.
      */
     public void queuePingForUpload(final Context context, final TelemetryCorePingBuilder pingBuilder) {
         final TelemetryOutgoingPing ping = pingBuilder.build();
         queuePingForUpload(context, ping, coreStore, uploadAllPingsImmediatelyScheduler);
     }
 
     /**
-     * Queues the given ping for upload and potentially schedules upload. This method can be called from any thread.
-     */
-    public void queuePingForUpload(final Context context, final TelemetryActivationPingBuilder pingBuilder) {
-        final TelemetryOutgoingPing ping = pingBuilder.build();
-        queuePingForUpload(context, ping, coreStore, uploadAllPingsImmediatelyScheduler);
-    }
-
-    /**
      * Queues the given crash ping for upload and potentially schedules upload. This method can be called from any thread.
      */
     public void queuePingForUpload(final Context context, final TelemetryCrashPingBuilder pingBuilder) {
         final TelemetryOutgoingPing ping = pingBuilder.build();
         queuePingForUpload(context, ping, crashStore, uploadAllPingsImmediatelyScheduler);
     }
 
     /* package-private */ static class QueuePingRunnable implements Runnable {
--- a/mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryUploadService.java
+++ b/mobile/android/base/java/org/mozilla/gecko/telemetry/TelemetryUploadService.java
@@ -14,17 +14,16 @@ import org.mozilla.gecko.GeckoProfile;
 import org.mozilla.gecko.JobIdsConstants;
 import org.mozilla.gecko.preferences.GeckoPreferences;
 import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.restrictions.Restrictions;
 import org.mozilla.gecko.sync.ExtendedJSONObject;
 import org.mozilla.gecko.sync.net.BaseResource;
 import org.mozilla.gecko.sync.net.BaseResourceDelegate;
 import org.mozilla.gecko.sync.net.Resource;
-import org.mozilla.gecko.telemetry.pingbuilders.TelemetryActivationPingBuilder;
 import org.mozilla.gecko.telemetry.stores.TelemetryPingStore;
 import org.mozilla.gecko.util.DateUtil;
 import org.mozilla.gecko.util.NetworkUtils;
 import org.mozilla.gecko.util.StringUtils;
 
 import java.io.IOException;
 import java.net.URISyntaxException;
 import java.security.GeneralSecurityException;
@@ -121,46 +120,27 @@ public class TelemetryUploadService exte
             delegate.setDocID(ping.getDocID());
             final String url = serverSchemeHostPort + "/" + ping.getURLPath();
             uploadPayload(url, ping.getPayload(), delegate);
 
             // There are minimal gains in trying to upload if we already failed one attempt.
             if (delegate.hadConnectionError()) {
                 break;
             }
-
-            checkPingsPersistence(context, ping.getDocID());
         }
 
         final boolean wereAllUploadsSuccessful = !delegate.hadConnectionError();
         if (wereAllUploadsSuccessful) {
             // We don't log individual successful uploads to avoid log spam.
             Log.d(LOGTAG, "Telemetry upload success!");
         }
         store.onUploadAttemptComplete(successfulUploadIDs);
         return wereAllUploadsSuccessful;
     }
 
-    /**
-     * Check if we have any pings that need to persist their succesful upload status in order to prevent further attempts.
-     * E.g. {@link TelemetryActivationPingBuilder}
-     * @param context
-     */
-    private static void checkPingsPersistence(Context context, String successfulUploadID) {
-        final String activationID = TelemetryActivationPingBuilder.getActivationPingId(context);
-
-        if(activationID == null) {
-            return;
-        }
-
-        if(activationID.equals(successfulUploadID)) {
-            TelemetryActivationPingBuilder.setActivationPingSent(context, true);
-        }
-    }
-
     private static void uploadPayload(final String url, final ExtendedJSONObject payload, final ResultDelegate delegate) {
         final BaseResource resource;
         try {
             resource = new BaseResource(url);
         } catch (final URISyntaxException e) {
             Log.w(LOGTAG, "URISyntaxException for server URL when creating BaseResource: returning.");
             return;
         }
deleted file mode 100644
--- a/mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetryActivationPingBuilder.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.mozilla.gecko.telemetry.pingbuilders;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.os.Build;
-import android.support.annotation.NonNull;
-
-import org.mozilla.gecko.AppConstants;
-import org.mozilla.gecko.GeckoSharedPrefs;
-import org.mozilla.gecko.Locales;
-import org.mozilla.gecko.distribution.DistributionStoreCallback;
-import org.mozilla.gecko.telemetry.TelemetryOutgoingPing;
-import org.mozilla.gecko.util.DateUtil;
-import org.mozilla.gecko.util.StringUtils;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Locale;
-
-/**
- * Builds a {@link TelemetryOutgoingPing} representing a activation ping.
- *
- */
-public class TelemetryActivationPingBuilder extends TelemetryPingBuilder {
-    private static final String LOGTAG = StringUtils.safeSubstring(TelemetryActivationPingBuilder.class.getSimpleName(), 0, 23);
-
-    //Using MOZ_APP_BASENAME would be more elegant but according to the server side schema we need to be sure that we always send the "Fennec" value.
-    private static final String APP_NAME_VALUE = "Fennec";
-
-    private static final String PREFS_ACTIVATION_ID = "activation_ping_id";
-    private static final String PREFS_ACTIVATION_SENT = "activation_ping_sent";
-
-    private static final String NAME = "activation";
-    private static final int VERSION_VALUE = 1;
-
-    private static final String IDENTIFIER = "identifier";
-    private static final String CLIENT_ID = "clientId";
-    private static final String MANUFACTURER = "manufacturer";
-    private static final String MODEL = "model";
-    private static final String DISTRIBUTION_ID = "distribution_id";
-    private static final String LOCALE = "locale";
-    private static final String OS_ATTR = "os";
-    private static final String OS_VERSION = "osversion";
-    private static final String PING_CREATION_DATE = "created";
-    private static final String TIMEZONE_OFFSET = "tz";
-    private static final String APP_NAME = "app_name";
-    private static final String CHANNEL = "channel";
-
-    public TelemetryActivationPingBuilder(final Context context) {
-        super(VERSION_VALUE, true);
-        initPayloadConstants(context);
-    }
-
-    private void initPayloadConstants(final Context context) {
-        payload.put(MANUFACTURER, Build.MANUFACTURER);
-        payload.put(MODEL, Build.MODEL);
-        payload.put(LOCALE, Locales.getLanguageTag(Locale.getDefault()));
-        payload.put(OS_ATTR, TelemetryPingBuilder.OS_NAME);
-        payload.put(OS_VERSION, Integer.toString(Build.VERSION.SDK_INT)); // A String for cross-platform reasons.
-
-        final Calendar nowCalendar = Calendar.getInstance();
-        final DateFormat pingCreationDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
-        payload.put(PING_CREATION_DATE, pingCreationDateFormat.format(nowCalendar.getTime()));
-        payload.put(TIMEZONE_OFFSET, DateUtil.getTimezoneOffsetInMinutesForGivenDate(nowCalendar));
-        payload.put(APP_NAME, APP_NAME_VALUE);
-        payload.put(CHANNEL, AppConstants.ANDROID_PACKAGE_NAME);
-
-        SharedPreferences prefs = GeckoSharedPrefs.forApp(context);
-        final String distributionId = prefs.getString(DistributionStoreCallback.PREF_DISTRIBUTION_ID, null);
-        if (distributionId != null) {
-            payload.put(DISTRIBUTION_ID, distributionId);
-        }
-
-        prefs.edit().putString(PREFS_ACTIVATION_ID, docID).apply();
-    }
-
-    public static boolean activationPingAlreadySent(Context context) {
-        return GeckoSharedPrefs.forApp(context).getBoolean(PREFS_ACTIVATION_SENT, false);
-    }
-
-    public static void setActivationPingSent(Context context, boolean value) {
-        SharedPreferences prefs = GeckoSharedPrefs.forApp(context);
-        prefs.edit().putBoolean(PREFS_ACTIVATION_SENT, value).apply();
-        prefs.edit().remove(PREFS_ACTIVATION_ID).apply();
-    }
-
-    public static String getActivationPingId(Context context) {
-        return GeckoSharedPrefs.forApp(context).getString(PREFS_ACTIVATION_ID, null);
-    }
-
-    @Override
-    public String getDocType() {
-        return NAME;
-    }
-
-    @Override
-    public String[] getMandatoryFields() {
-        return new String[] {
-                MANUFACTURER,
-                MODEL,
-                LOCALE,
-                OS_ATTR,
-                OS_VERSION,
-                PING_CREATION_DATE,
-                TIMEZONE_OFFSET,
-                APP_NAME,
-                CHANNEL
-        };
-    }
-
-    public TelemetryActivationPingBuilder setIdentifier(@NonNull final String identifier) {
-        if (identifier == null) {
-            throw new IllegalArgumentException("Expected non-null identifier");
-        }
-
-        payload.put(IDENTIFIER, identifier);
-        return this;
-    }
-
-    public TelemetryActivationPingBuilder setClientID(@NonNull final String clientID) {
-        if (clientID == null) {
-            throw new IllegalArgumentException("Expected non-null clientID");
-        }
-        payload.put(CLIENT_ID, clientID);
-        return this;
-    }
-}
--- a/mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetryPingBuilder.java
+++ b/mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetryPingBuilder.java
@@ -20,19 +20,16 @@ import java.util.UUID;
  * This base class handles the common ping operations under the hood:
  *   * Validating mandatory fields
  *   * Forming the server url
  */
 abstract class TelemetryPingBuilder {
     // In the server url, the initial path directly after the "scheme://host:port/"
     private static final String SERVER_INITIAL_PATH = "submit/telemetry";
 
-    // Modern pings now use a structured ingestion where we capture the schema version as one of the URI parameters.
-    private static final String SERVER_INITIAL_PATH_MODERN = "submit/mobile";
-
     // By default Fennec ping's use the old telemetry version, this can be overridden
     private static final int DEFAULT_TELEMETRY_VERSION = 1;
 
     // Unified telemetry is version 4
     public static final int UNIFIED_TELEMETRY_VERSION = 4;
 
     // We deliberately call the OS/platform Android to avoid confusion with desktop Linux
     public static final String OS_NAME = "Android";
@@ -46,22 +43,16 @@ abstract class TelemetryPingBuilder {
     }
 
     public TelemetryPingBuilder(int version) {
         docID = UUID.randomUUID().toString();
         serverPath = getTelemetryServerPath(getDocType(), docID, version);
         payload = new ExtendedJSONObject();
     }
 
-    public TelemetryPingBuilder(int version, boolean modernPing) {
-        docID = UUID.randomUUID().toString();
-        serverPath = modernPing ? getModernTelemetryServerPath(getDocType(), docID, version) : getTelemetryServerPath(getDocType(), docID, version);
-        payload = new ExtendedJSONObject();
-    }
-
     /**
      * @return the name of the ping (e.g. "core")
      */
     public abstract String getDocType();
 
     /**
      * @return the fields that are mandatory for the resultant ping to be uploaded to
      *         the server. These will be validated before the ping is built.
@@ -104,27 +95,9 @@ abstract class TelemetryPingBuilder {
                 docID + '/' +
                 docType + '/' +
                 appName + '/' +
                 appVersion + '/' +
                 appUpdateChannel + '/' +
                 appBuildId +
                 (version == UNIFIED_TELEMETRY_VERSION ? "?v=4" : "");
     }
-
-    /**
-     * Returns a url of the format:
-     *   http://hostname/submit/mobile/docType/appVersion/docId/
-     *
-     *   User for modern structured ingestion.
-     *
-     * @param docType The name of the ping (e.g. "main")
-     * @param docID A UUID that identifies the ping
-     * @param version The ping format version
-     * @return a url at which to POST the telemetry data to
-     */
-    private static String getModernTelemetryServerPath(final String docType, final String docID, int version) {
-        return SERVER_INITIAL_PATH_MODERN + '/' +
-                docType + '/' +
-                version + '/' +
-                docID;
-    }
 }