Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Remove legacy service-telemetry. (#3679)
Browse files Browse the repository at this point in the history
  • Loading branch information
daoshengmu authored Jul 15, 2020
1 parent db4bae0 commit b0accfc
Show file tree
Hide file tree
Showing 18 changed files with 0 additions and 833 deletions.
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ dependencies {
// Android Components
implementation deps.mozilla_speech.library
implementation deps.mozilla_speech.utils
implementation deps.android_components.telemetry
implementation deps.android_components.browser_errorpages
implementation deps.android_components.browser_search
implementation deps.android_components.browser_state
Expand Down
18 changes: 0 additions & 18 deletions app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,24 +261,6 @@ control:
- [email protected]
expires: "2020-11-01"

legacy_telemetry:
client_id:
type: uuid
description: >
A UUID uniquely identifying the legacy telemetry client id.
This is used for supporting legacy telemetry in the `deletion-request`
ping.
send_in_pings:
- deletion-request
bugs:
- https://github.com/MozillaReality/FirefoxReality/issues/3324
data_reviews:
- https://github.com/MozillaReality/FirefoxReality/pull/3467#issuecomment-642847632
notification_emails:
- [email protected]
- [email protected]
expires: "2020-11-01"

pages:
page_load:
type: timing_distribution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import org.mozilla.vrbrowser.input.MotionEventGenerator;
import org.mozilla.vrbrowser.search.SearchEngineWrapper;
import org.mozilla.vrbrowser.telemetry.GleanMetricsService;
import org.mozilla.vrbrowser.telemetry.TelemetryWrapper;
import org.mozilla.vrbrowser.ui.OffscreenDisplay;
import org.mozilla.vrbrowser.ui.adapters.Language;
import org.mozilla.vrbrowser.ui.widgets.AppServicesProvider;
Expand Down Expand Up @@ -412,16 +411,13 @@ private void attachToWindow(@NonNull WindowWidget aWindow, @Nullable WindowWidge
protected void onStart() {
SettingsStore.getInstance(getBaseContext()).setPid(Process.myPid());
super.onStart();
TelemetryWrapper.start();
mLifeCycle.setCurrentState(Lifecycle.State.STARTED);
}

@Override
protected void onStop() {
SettingsStore.getInstance(getBaseContext()).setPid(0);
super.onStop();

TelemetryWrapper.stop();
GleanMetricsService.sessionStop();
}

Expand Down Expand Up @@ -1018,7 +1014,6 @@ void onEnterWebXR() {
listener.onEnterWebXR();
}
});
TelemetryWrapper.startImmersive();
GleanMetricsService.startImmersive();

PauseCompositorRunnable runnable = new PauseCompositorRunnable();
Expand Down Expand Up @@ -1052,7 +1047,6 @@ void onExitWebXR(long aCallback) {
// Show the window in front of you when you exit immersive mode.
recenterUIYaw(WidgetManagerDelegate.YAW_TARGET_ALL);

TelemetryWrapper.uploadImmersiveToHistogram();
GleanMetricsService.stopImmersive();
Handler handler = new Handler(Looper.getMainLooper());
handler.postDelayed(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.mozilla.vrbrowser.db.DataRepository;
import org.mozilla.vrbrowser.downloads.DownloadsManager;
import org.mozilla.vrbrowser.telemetry.GleanMetricsService;
import org.mozilla.vrbrowser.telemetry.TelemetryWrapper;
import org.mozilla.vrbrowser.ui.adapters.Language;
import org.mozilla.vrbrowser.ui.widgets.AppServicesProvider;
import org.mozilla.vrbrowser.utils.BitmapCache;
Expand Down Expand Up @@ -61,7 +60,6 @@ public void onCreate() {
Looper.getMainLooper().getThread();

SessionStore.prefOverrides(this);
TelemetryWrapper.init(this, EngineProvider.INSTANCE.getDefaultClient(this));
GleanMetricsService.init(this, EngineProvider.INSTANCE.getDefaultClient(this));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
import org.json.JSONObject;
import org.mozilla.geckoview.ContentBlocking;
import org.mozilla.geckoview.GeckoSessionSettings;
import org.mozilla.telemetry.TelemetryHolder;
import org.mozilla.vrbrowser.BuildConfig;
import org.mozilla.vrbrowser.R;
import org.mozilla.vrbrowser.VRBrowserActivity;
import org.mozilla.vrbrowser.VRBrowserApplication;
import org.mozilla.vrbrowser.browser.engine.EngineProvider;
import org.mozilla.vrbrowser.telemetry.GleanMetricsService;
import org.mozilla.vrbrowser.telemetry.TelemetryWrapper;
import org.mozilla.vrbrowser.ui.viewmodel.SettingsViewModel;
import org.mozilla.vrbrowser.ui.widgets.menus.library.SortingContextMenuWidget;
import org.mozilla.vrbrowser.utils.DeviceType;
Expand Down Expand Up @@ -209,23 +207,8 @@ public void setTelemetryEnabled(boolean isEnabled) {
editor.putBoolean(mContext.getString(R.string.settings_key_telemetry), isEnabled);
editor.commit();

// We send before disabling in case of opting-out
if (!isEnabled) {
TelemetryWrapper.telemetryStatus(false);
}

// If the state of Telemetry is not the same, we reinitialize it.
final boolean hasEnabled = isTelemetryEnabled();
if (hasEnabled != isEnabled) {
TelemetryWrapper.init(mContext, EngineProvider.INSTANCE.getDefaultClient(mContext));
}

TelemetryHolder.get().getConfiguration().setUploadEnabled(isEnabled);
TelemetryHolder.get().getConfiguration().setCollectionEnabled(isEnabled);

// We send after enabling in case of opting-in
if (isEnabled) {
TelemetryWrapper.telemetryStatus(true);
GleanMetricsService.start();
} else {
GleanMetricsService.stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import org.mozilla.vrbrowser.browser.content.TrackingProtectionStore;
import org.mozilla.vrbrowser.geolocation.GeolocationData;
import org.mozilla.vrbrowser.telemetry.GleanMetricsService;
import org.mozilla.vrbrowser.telemetry.TelemetryWrapper;
import org.mozilla.vrbrowser.utils.BitmapCache;
import org.mozilla.vrbrowser.utils.InternalPages;
import org.mozilla.vrbrowser.utils.SystemUtils;
Expand Down Expand Up @@ -1181,7 +1180,6 @@ public void onPageStart(@NonNull GeckoSession aSession, @NonNull String aUri) {
}
Log.d(LOGTAG, "Session onPageStart");
mState.mIsLoading = true;
TelemetryWrapper.startPageLoadTime();
GleanMetricsService.startPageLoadTime(aUri);

setWebXRState(SessionState.WEBXR_UNUSED);
Expand All @@ -1198,7 +1196,6 @@ public void onPageStop(@NonNull GeckoSession aSession, boolean b) {
Log.d(LOGTAG, "Session onPageStop");
mState.mIsLoading = false;
if (!SessionUtils.isLocalizedContent(mState.mUri)) {
TelemetryWrapper.uploadPageLoadToHistogram(mState.mUri);
GleanMetricsService.stopPageLoadTimeWithURI(mState.mUri);
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
import androidx.annotation.UiThread;
import androidx.annotation.VisibleForTesting;

import org.mozilla.telemetry.TelemetryHolder;
import org.mozilla.vrbrowser.BuildConfig;
import org.mozilla.vrbrowser.GleanMetrics.Control;
import org.mozilla.vrbrowser.GleanMetrics.Distribution;
import org.mozilla.vrbrowser.GleanMetrics.FirefoxAccount;
import org.mozilla.vrbrowser.GleanMetrics.Immersive;
import org.mozilla.vrbrowser.GleanMetrics.LegacyTelemetry;
import org.mozilla.vrbrowser.GleanMetrics.Pages;
import org.mozilla.vrbrowser.GleanMetrics.Pings;
import org.mozilla.vrbrowser.GleanMetrics.Searches;
Expand All @@ -31,7 +29,6 @@
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Map;
import java.util.UUID;

import mozilla.components.concept.fetch.Client;
import mozilla.components.service.glean.Glean;
Expand Down Expand Up @@ -71,9 +68,6 @@ public static void init(@NonNull Context aContext, @NonNull Client client) {
} else {
GleanMetricsService.stop();
}

LegacyTelemetry.INSTANCE.clientId().set(UUID.fromString(TelemetryHolder.get().getClientId()));

Configuration config = new Configuration(
ConceptFetchHttpUploader.fromClient(client),
Configuration.DEFAULT_TELEMETRY_ENDPOINT,
Expand Down

This file was deleted.

Loading

0 comments on commit b0accfc

Please sign in to comment.