Bug 1566367 - [3.0] Add GVE example telemetry delegate. r=snorp

Differential Revision: https://phabricator.services.mozilla.com/D38900

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Eugen Sawin 2019-08-09 04:51:07 +00:00
Родитель 2708b11d94
Коммит 5efb6dc130
1 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -19,6 +19,7 @@ import org.mozilla.geckoview.GeckoView;
import org.mozilla.geckoview.WebExtension; import org.mozilla.geckoview.WebExtension;
import org.mozilla.geckoview.WebExtensionController; import org.mozilla.geckoview.WebExtensionController;
import org.mozilla.geckoview.WebRequestError; import org.mozilla.geckoview.WebRequestError;
import org.mozilla.geckoview.RuntimeTelemetry;
import android.Manifest; import android.Manifest;
import android.app.Activity; import android.app.Activity;
@ -152,7 +153,8 @@ public class GeckoViewActivity extends AppCompatActivity {
.contentBlocking(new ContentBlocking.Settings.Builder() .contentBlocking(new ContentBlocking.Settings.Builder()
.categories(ContentBlocking.AT_DEFAULT) .categories(ContentBlocking.AT_DEFAULT)
.build()) .build())
.crashHandler(ExampleCrashHandler.class); .crashHandler(ExampleCrashHandler.class)
.telemetryDelegate(new ExampleTelemetryDelegate());
sGeckoRuntime = GeckoRuntime.create(this, runtimeSettingsBuilder.build()); sGeckoRuntime = GeckoRuntime.create(this, runtimeSettingsBuilder.build());
@ -1145,4 +1147,12 @@ public class GeckoViewActivity extends AppCompatActivity {
notificationManager.notify(mNotificationId, builder.build()); notificationManager.notify(mNotificationId, builder.build());
} }
} }
private final class ExampleTelemetryDelegate
implements RuntimeTelemetry.Delegate {
@Override
public void onTelemetryReceived(final @NonNull RuntimeTelemetry.Metric metric) {
Log.d(LOGTAG, "onTelemetryReceived " + metric);
}
}
} }