Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions packages/devtools_app/lib/src/shared/server/_analytics_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,6 @@

part of 'server.dart';

/// Request DevTools property value 'firstRun' (GA dialog) stored in the file
/// '~/flutter-devtools/.devtools'.
Future<bool> isFirstRun() async {
bool firstRun = false;
if (isDevToolsServerAvailable) {
final resp = await request(apiGetDevToolsFirstRun);
if (resp?.statusCode == 200) {
firstRun = json.decode(resp!.body);
} else {
logWarning(resp, apiGetDevToolsFirstRun);
}
}
return firstRun;
}

/// Requests the Flutter client id from the Flutter store file ~\.flutter.
///
/// If an empty String is returned, this means that Flutter Tool has never been
Expand Down
8 changes: 5 additions & 3 deletions packages/devtools_shared/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.
-->
# 13.0.0-wip
* Deprecated `DevToolsStoreKeys.analyticsEnabled` since this is only used for legacy analytics.
* **Breaking change:** Removed legacy analytics APIs and state cleanup (e.g. `apiGetFlutterGAEnabled`, `apiGetDevToolsEnabled`, `apiSetDevToolsEnabled`).
* **Breaking change:** Removed `DevToolsStoreKeys.analyticsEnabled` and
`DevToolsStoreKeys.isFirstRun` since these were only used for legacy analytics.
* **Breaking change:** Removed legacy analytics APIs and state cleanup
(e.g. `apiGetFlutterGAEnabled`, `apiGetDevToolsEnabled`, `apiSetDevToolsEnabled`, `apiGetDevToolsFirstRun`, `apiResetDevTools`).
* **Breaking change:** Removed public constant `devToolsEnabledPropertyName`.
* **Breaking change:** Removed the `analyticsEnabled` getter and setter from `DevToolsUsage`.
* **Breaking change:** Removed `isFirstRun`, `reset`, and `analyticsEnabled` from `DevToolsUsage`.

# 12.1.0
* Adds additional logging to `IntegrationTestRunner`.
Expand Down
4 changes: 0 additions & 4 deletions packages/devtools_shared/lib/src/devtools_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ const apiParameterVmServiceConnected = 'connected';
/// Flutter GA properties APIs:
const apiGetFlutterGAClientId = '${apiPrefix}getFlutterGAClientId';

/// DevTools GA properties APIs:
const apiResetDevTools = '${apiPrefix}resetDevTools';
const apiGetDevToolsFirstRun = '${apiPrefix}getDevToolsFirstRun';

abstract class PreferencesApi {
/// Returns the preference value in the DevTools store file for the key
/// specified by the [preferenceKeyProperty] query parameter.
Expand Down
29 changes: 6 additions & 23 deletions packages/devtools_shared/lib/src/server/devtools_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
import 'file_system.dart';

enum DevToolsStoreKeys {
/// The key holding the value for whether Google Analytics (legacy) for
/// DevTools have been enabled.
@Deprecated(
'Use unified_analytics instead; this key is for legacy analytics and will '
'be removed.',
)
analyticsEnabled,

/// The key holding the value for whether this is a user's first run of
/// DevTools.
isFirstRun,

/// The key holding the value for the last DevTools version that the user
/// viewed release notes for.
lastReleaseNotesVersion,
Expand Down Expand Up @@ -59,19 +47,14 @@ class DevToolsUsage {

late IOPersistentProperties properties;

void reset() {
properties.remove(DevToolsStoreKeys.isFirstRun.name);
}

void _removeLegacyKeys() {
// TODO(https://github.com/flutter/devtools/issues/9775): remove this logic
// once legacy keys have been removed for ~1 year.
properties.remove(DevToolsStoreKeys.analyticsEnabled.name);
}

bool get isFirstRun {
return properties[DevToolsStoreKeys.isFirstRun.name] =
properties[DevToolsStoreKeys.isFirstRun.name] == null;
// once legacy keys have been removed for ~1 year. We are intentionally
// using raw strings instead of values from [DevToolsStoreKeys] to avoid
// unnecessary breaking changes in the future.
properties
..remove('analyticsEnabled')
..remove('isFirstRun');
}

bool surveyNameExists(String surveyName) => properties[surveyName] != null;
Expand Down
10 changes: 0 additions & 10 deletions packages/devtools_shared/lib/src/server/server_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ class ServerApi {
api: api,
);

// ----- DevTools Store. -----

case apiResetDevTools:
_devToolsStore.reset();
return _encodeResponse(true, api: api);
case apiGetDevToolsFirstRun:
// Has DevTools been run first time? To bring up analytics dialog.
final isFirstRun = _devToolsStore.isFirstRun;
return _encodeResponse(isFirstRun, api: api);

// ----- Preferences api. -----
case PreferencesApi.getPreferenceValue:
return _PreferencesApiHandler.getPreferenceValue(
Expand Down
Loading