Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
cd3aec36
Unverified
Commit
cd3aec36
authored
Dec 04, 2020
by
Zachary Anderson
Committed by
GitHub
Dec 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tool] Report analytics as disabled when suppressed (#71728)
parent
a12c22b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
config.dart
packages/flutter_tools/lib/src/commands/config.dart
+3
-1
config_test.dart
...utter_tools/test/commands.shard/hermetic/config_test.dart
+21
-0
No files found.
packages/flutter_tools/lib/src/commands/config.dart
View file @
cd3aec36
...
...
@@ -84,9 +84,11 @@ class ConfigCommand extends FlutterCommand {
if
(
values
.
isEmpty
)
{
values
=
' No settings have been configured.'
;
}
final
bool
analyticsEnabled
=
globals
.
flutterUsage
.
enabled
&&
!
globals
.
flutterUsage
.
suppressAnalytics
;
return
'
\n
Settings:
\n
$values
\n\n
'
'Analytics reporting is currently
${
globals.flutterUsage.e
nabled ? 'enabled' : 'disabled'}
.'
;
'Analytics reporting is currently
${
analyticsE
nabled ? 'enabled' : 'disabled'}
.'
;
}
/// Return null to disable analytics recording of the `config` command.
...
...
packages/flutter_tools/test/commands.shard/hermetic/config_test.dart
View file @
cd3aec36
...
...
@@ -288,6 +288,24 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
mockUsage
,
});
testUsingContext
(
'analytics reported disabled when suppressed'
,
()
async
{
final
ConfigCommand
configCommand
=
ConfigCommand
();
final
CommandRunner
<
void
>
commandRunner
=
createTestCommandRunner
(
configCommand
);
mockUsage
.
suppressAnalytics
=
true
;
await
commandRunner
.
run
(<
String
>[
'config'
,
]);
expect
(
testLogger
.
statusText
,
containsIgnoringWhitespace
(
'Analytics reporting is currently disabled'
),
);
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
mockUsage
,
});
});
}
...
...
@@ -306,4 +324,7 @@ class MockFlutterVersion extends Mock implements FlutterVersion {}
class
MockUsage
extends
Mock
implements
Usage
{
@override
bool
enabled
=
true
;
@override
bool
suppressAnalytics
=
false
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment