Allow analytics gathering for any clients that can display a message
This test was added before the unified analytics package and was intended to guard against gathering analytics where we were not allowed to do so. We can now gather analytics from other clients as long as we have displayed the appropriate message, and that should be a sufficient check at this point. Change-Id: I1ec68439cb1048d99fbbdec2084332e8e830235a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417861 Commit-Queue: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Phil Quitslund <pquitslund@google.com> Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
This commit is contained in:
committed by
Commit Queue
parent
cd07d191fc
commit
7f74e064b0
@@ -207,20 +207,23 @@ class Driver implements ServerStarter {
|
||||
var defaultSdk = _createDefaultSdk(defaultSdkPath);
|
||||
|
||||
// Create the analytics manager.
|
||||
AnalyticsManager analyticsManager;
|
||||
Analytics analytics;
|
||||
if (disableAnalyticsForSession) {
|
||||
analyticsManager = AnalyticsManager(NoOpAnalytics());
|
||||
analytics = NoOpAnalytics();
|
||||
} else {
|
||||
// TODO(jcollins): implement a full map of `clientId`s to tools to cover
|
||||
// more analyzer entry points than vscode.
|
||||
if (clientId == 'VS-Code' || clientId == 'VS-Code-Remote') {
|
||||
analyticsManager = AnalyticsManager(
|
||||
_createAnalytics(defaultSdk, defaultSdkPath, DashTool.vscodePlugins),
|
||||
);
|
||||
var tool = switch (clientId) {
|
||||
'VS-Code' || 'VS-Code-Remote' => DashTool.vscodePlugins,
|
||||
'IntelliJ-IDEA' => DashTool.intellijPlugins,
|
||||
'Android-Studio' => DashTool.androidStudioPlugins,
|
||||
_ => null,
|
||||
};
|
||||
if (tool != null) {
|
||||
analytics = _createAnalytics(defaultSdk, defaultSdkPath, tool);
|
||||
} else {
|
||||
analyticsManager = AnalyticsManager(NoOpAnalytics());
|
||||
analytics = NoOpAnalytics();
|
||||
}
|
||||
}
|
||||
var analyticsManager = AnalyticsManager(analytics);
|
||||
|
||||
bool shouldSendCallback() {
|
||||
// Check sdkConfig to optionally force reporting on.
|
||||
|
||||
Reference in New Issue
Block a user